Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Let's see
Message
De
30/03/2021 09:45:48
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
30/03/2021 09:38:58
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01679334
Message ID:
01679348
Vues:
49
>>>>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]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform