Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String manipulation (preferably without RegExp)
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01167490
Message ID:
01167545
Views:
7
>Instead of the other solution that works in 9 you can try
>
>
>lcNumbers	=  Alltrim(chrtran("A-B123Q4E", "ABCDEFGHIJKLMNOPQRSTUVWXYZ-", Space(26)))
>? At(' ', lcNumbers) - 1
>? Left(lcNumbers, At(' ', lcNumbers) - 1)
>? substr(lcNumbers, At(' ', lcNumbers) + 1)
>
What if I don't have a letter at the beginning or don't have letters at all?

Anyway, this
lcNumbers = Alltrim(chrtran("A-B123Q4E", "ABCDEFGHIJKLMNOPQRSTUVWXYZ-", Space(26)))
MESSAGEBOX(GETWORDCOUNT(lcNumbers))
seems to work.

Thanks again.
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