Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing Spaces from Charter String
Message
From
15/11/1999 00:03:06
 
 
To
12/11/1999 23:14:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00290863
Message ID:
00291148
Views:
23
>Found it!
>
>FOR nCnt = 1 TO 10
> cCharacter = SUBSTR(cTest, nCnt, 1)
> IF ISDIGIT(cCharacter)
> cNumOnly = cNumOnly + cCharacter
> ELSE
> IF ISALPHA(cCharacter)
> cNumOnly = cNumOnly + cCharacter
> ENDIF
> ENDIF
>ENDFOR


Hi Roelaux (from a former Alabamian):

You can do better than this.

To remove embedded spaces:

chrtran(cTest," ","")


To remove all but alphanumeric (upper) characters:

chrtran(cTest,chrtran(cTest,"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",""),"")


Should be much faster (not to mention slicker :).


Peter Robinson

(My son and I will be rolling down to Birmingham to spend Thanksgiving with my bro and his family.)
Peter Robinson ** Rodes Design ** Virginia
Previous
Reply
Map
View

Click here to load this message in the networking platform