Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Let's see
Message
From
30/03/2021 09:45:48
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
30/03/2021 09:38:58
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01679334
Message ID:
01679348
Views:
50
>>>>or
>>>>
>>>>lcString="ABC,DEF,GHI,JKL"
>>>>lcString2 = lcString
>>>>FOR i = Occurs(',',lcString2) TO 1 STEP -1
>>>>	lcString2 = STUFF(lcString2,At(',',lcString2,i),1,'')
>>>>endfor
>>>>?lcString2
>>>>
>>>
>>>"Yes, but can you make it an one-liner?" :)
>>
>>There was a trick ...
>>
>>?removechar("ABC,DEF,GHI,JKL",',')
>>
>>function removechar
>>lpara lcString2, lcChar
>>FOR i = Occurs(lcChar,lcString2) TO 1 STEP -1
>>	lcString2 = STUFF(lcString2,At(lcChar,lcString2,i),1,'')
>>endfor
>>return lcString2
>>endfunc
>>
>
>I can cheat too... steal the code from myself (which I stole from someone else long ago):
>
>?chrtran("ABC,DEF,GHI,JKL", chrtran("ABC,DEF,GHI,JKL", ",", ""), "")
>
>See message #01669287
>
>Okay, it does the opposite... should be
>
>?chrtran("ABC,DEF,GHI,JKL", chrtran("ABC,DEF,GHI,JKL", "ABCDEFGHIJKL", ""), "")

Cheat!EinsElf! Change while I reply!
Teh idea was
?chrtran("ABC,DEF,GHI,JKL", chrtran("ABC,DEF,GHI,JKL", chrtran("ABC,DEF,GHI,JKL", ",", ""), ""), "")
I guess
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform