Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing for numeric char in a string
Message
From
16/11/2001 19:34:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00582918
Message ID:
00583044
Views:
26
>What's the best way to test for the existance of a numeric char in a string? If I had dumbvar='Johnson x4588', I would want to know that there are numbers embedded. -TB
This is overkill for this problem, but the VBScript.RegExp object allows you to check for a wide range of patterns in a string:
oRegExp = CREATEOBJ('VBScript.RegExp')
WITH oRegExp
   .Pattern = '[0-9]'
   ? .Test(dumbvar)
ENDWITH
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform