Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find number within string
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00237774
Message ID:
00237802
Views:
8
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
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform