Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quickly alltrim non-alpha chars from string
Message
From
01/08/2005 16:36:06
 
 
To
01/08/2005 16:08:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01037589
Message ID:
01037619
Views:
23
>Hi Herman,
>
>Clever ideas but I need to alltrim any non-alpha char, not just numeric digits. Basically I'm looking for something like VFP9's alltrim() but with a list of ~ 203 char codes to trim or a function like Foxtool's Reduce() that alltrims() vs. "reduces" (sort of).
>

Sorry, I didn't read carefully too <bg>
Would this work?
cAlpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
nStartPos = at( left( chrtran( pcStr, chrtran( pcStr, cAlpha, '' ), '' ), 1 ), pcStr )
nEndPos = rat( left( chrtran( pcStr, chrtran( pcStr, cAlpha, '' ), '' ), 1 ), pcStr )
?substr( pcStr, nStartPos, nEndPos - nStartPos + 1 )
>Just sent you some email as well.

Thanks! You are a handsome man though :)

Regards
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform