Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing for numeric char in a string
Message
De
16/11/2001 19:34:19
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00582918
Message ID:
00583044
Vues:
28
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform