Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing Spaces from Charter String
Message
De
15/11/1999 00:03:06
 
 
À
12/11/1999 23:14:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00290863
Message ID:
00291148
Vues:
24
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform