Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find number within string
Message
From
06/07/1999 11:13:34
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00237774
Message ID:
00237779
Views:
11
>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"
>
>any help appreciated:)

I would probably consider writing a function that I could pass the string in question to. I would then determine the length of the string and traverse through it one char at a time. In finding the first char that was a number, I would store it and keep moving until I ran out of numeric chars. Convert the chars found to a number and return it to the calling routine...

HTH
Michael
Previous
Reply
Map
View

Click here to load this message in the networking platform