Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quickly alltrim non-alpha chars from string
Message
 
 
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:
01037622
Views:
25
Hi Malcolm,
local lcOriginalString, lcTempString, lnFirstAlpha, lnLastAlpha

lcTempString = chtran(lcOriginalString,"1234567890","")

lnFirstAlpha = at(left(lcTempString,1),lcOriginalString)
lnLastAlpha = rat(right(lcTempString,1), lcOriginalString)

lcNewString = substr(lcOriginalString, lnFirstAlpha, lnLastAlpha - lnFirstAlpha)
>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).
>
>Just sent you some email as well.
>
>Regards,
>Malcolm
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform