Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locating a number within a character string
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00364345
Message ID:
00364516
Views:
36
>>Doyle,
>>
>>>I'm looking for a function to locate the occurance of a number within a character string such as AT(). Thhanks to all.
>>
>>Please explain in more detail what you need. Do you mean you want to find "675" in a character string, or you want to find the first numeral in a character string, or look for all the 9's, or what?
>
>Try VAL(mystring)
>
>mystring = "ABCD2345DEFG"
>
>VAL(mystring) = 2345!

You're saying that this is the result he wants, right? The above will yield 0.00. However, with a little help from Foxtools:

mystring = "ABCD2345DEFG"
? VAL(Strfilter(mystring, "0123456789"))

produces 2345.00
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform