Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find number within string
Message
From
06/07/1999 14:02:39
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00237774
Message ID:
00237861
Views:
12
Hi, John-
Let us know will you? It seems like Todd's point is critical here. As long as we're all having fun, here is my humble offering. < s >
lnNum = 0
FOR lni = 1 TO LEN( lcString )
  lnNum = SUBSTR( lcString, lni )
  IF lnNUM <> 0 && We got us a number w/ no imbedded char :)
    EXIT && If you need all the numbers, you could strtran the found one out and continue
  ENDIF
  
NEXT lni
IF lnNum = 0
  *!* Do what you want to now that you have it.
  *!* Note, if you need to find *real* 0s then you'd need to modify this logic.
ENDIF
>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:)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform