Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reverse comma-delimited string
Message
De
03/09/2019 14:46:57
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
03/09/2019 14:29:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01670542
Message ID:
01670544
Vues:
98
>I have a string like "one, two, three" and I need it to be in the order "three, two, one".
>
>Does anybody have an efficient algorithm to do this?

LPARAMETERS tcText
LOCAL lnLines,lcText,x
LOCAL ARRAY laLines[1]
lnLines=ALINES(laLines,m.tcText,1,",")
lcText = laLines[m.lnLines]
FOR x = lnLines-1 TO 1 STEP -1
lcText = m.lcText + "," + laLines[m.x]
ENDFOR x
RETURN m.lcText
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform