Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find number within string
Message
From
06/07/1999 11:55:21
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00237774
Message ID:
00237804
Views:
12
PMFJI -- One caveat that occured to me with these commands everyone has offered is that they will pull ALL of the numbers out of the string, ie:

2nd #70 blue = 270

You may need to check more carefully to see if there is text between numbers and pull the numbers out seperately. Then again, you may not, and I may be wasting bandwidth :-)

>Hi John,
>
>>Is there a way to find a number within a string? Here's the twist, the number could be anywhere in the string, and I want to find any number...like this "#70 blue" or "70 blue" or "blue 70"
>
>My suggestion is similar to George's, except that you don't need FoxTool.Fll:
>
> ChrTran(lcString,ChrTran(lcString,"0123456789",""),"")
>
>The inner chrtran determines all characters that are not digits and are contained in the string. The outer ChrTran removes all of these characters. What remains are the digits. It's the same a StrFilter().
>
>Christof
--Todd Sherman
-Wake Up! Smell the Coffee!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform