Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Let's see
Message
From
30/03/2021 16:32:22
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
30/03/2021 15:10:43
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01679334
Message ID:
01679371
Views:
67
>Apart from prior chrtran() and strtran() offerings... you might avoid the duplicate substr():
>
>
lcString="ABC,DEF,GHI,JKL"
>lcString2=""
>x=0
>do while x<len(m.lcString)
>  x=m.x+1
>lcString3=SUBSTR(m.lcString,m.x,1)
>  IF m.lcString3<>","
>    lcString2=m.lcString2+m.lcString3
>  ENDIF
>enddo X
>?m.lcString2
>
>For enjoyers of left field:
>
>
lcString="ABC,DEF,GHI,JKL"
>lcString2=""
>licount=getwordcount(m.lcString,",")
>for x=1 to m.liCount
>   lcString2=m.lcString2+getwordnum(m.lcString,m.x,",")
>endfor
>?m.lcString2
>
>And then there's always strextract()...

Nice!
Previous
Reply
Map
View

Click here to load this message in the networking platform