Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reverse comma-delimited string
Message
From
03/09/2019 21:43:14
 
 
To
03/09/2019 14:38:42
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01670542
Message ID:
01670560
Views:
93
>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?

I would suggest a small change to Walter's solution:
x = "one, two, three"
cnt = GETWORDCOUNT(x, ",")
y = GETWORDNUM(x, cnt, ",")
FOR nT = cnt-1 TO 1 STEP -1
	y = y +"," + GETWORDNUM(x, nT, ",")
ENDFOR 
? Y
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform