Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quickly alltrim non-alpha chars from string
Message
 
 
À
02/08/2005 09:06:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01037589
Message ID:
01037793
Vues:
28
>Hi Herman,
>
>> It should be this:
>>
>>cAlpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
>>nStartPos = at( left( chrtran( pcStr, chrtran( pcStr, cAlpha, '' ), '' ), 1 ), pcStr )
>>nEndPos = rat( right( chrtran( pcStr, chrtran( pcStr, cAlpha, '' ), '' ), 1 ), pcStr )
>>?substr( pcStr, nStartPos, nEndPos - nStartPos + 1 )
>>
>
>Perfect! Thank you very much!
>
>Malcolm

I would use a temp variable instead of doing chrtran twice. See my code, I used the same idea.

Anyway, I'm curious if you can also try Craig's and Cetin's ideas for big strings...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform