| |
|
|
 Julian Schmidt | Wunsch: Befehl um einen Teilstring zu löschen
Vorübergehende Lösung:
CLS
print "String: 1,2,3,4,5,6,7,8,9"
print "Teilstring 8 löschen"
print "Ergebnis: "+DelSubStr("1,2,3,4,5,6,7,8,9",8,",")
Waitinput
Proc DelSubStr
Parameters Text$,Teil&,Trenn$
Declare Text2$
whileloop Len(Text$,Trenn$)
Text2$=Text2$+If((&loop<>If(Teil&<>1,1,2)) and (&loop<>Teil&),Trenn$,"")+If(&loop<>Teil&,SubStr$(Text$,&loop,Trenn$),"")
Endwhile
Return Text2$
EndProc
|
|
|
| |
|
|
|
 RGH | Ciao, das kann doch schonj die Funktion Del$:
print "Ergebnis: "+Del$("1,2,3,4,5,6,7,8,9",8,1,",")
Sie kann sogar ein bisschen mehr, da auch mehrere Teilstrings gelöscht werden können.
Saluto Roland |
|
|
| XProfan X2Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 01.01.2013 ▲ |
|
|
|
|
 Julian Schmidt | Stimmt!
RGH (01.01.13)
Sie kann sogar ein bisschen mehr, da auch mehrere Teilstrings gelöscht werden können.
Wird nicht in der Aiuto erwähnt. Beispiel? |
|
|
| |
|
|
|
 Jörg Sellmeyer |
Beispiel?
print "Ergebnis: "+Del$("1,2,3,4,5,6,7,8,9",6,2,",")
WaitInput
|
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 01.01.2013 ▲ |
|
|
|
|
 RGH | Erstens wird es in der Aiuto erwähnt und zweitens ist der dritte Parameter die Anzahl der Zeichen bzw. Teilstrings, die entfernt werden!
Zitat aus der Aiuto: "Wenn ein Trennzeichen angegeben ist: Ab der Teilstring-Position N1 werden N2 Teilstrings aus dem String entfernt."
Saluto Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 01.01.2013 ▲ |
|
|
|