Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opinions for best way to check a string for invalid Char
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00189473
Message ID:
00189619
Vues:
19
Marcus, try

*function ValidStr
lparameters str2check
local validchars,testchars
validchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "
testchars = space(len(validchars))
return len(alltrim(chrtran(str2check,validchars,testchars))) = 0

Using validchars as above ValidStr("Silvio") will return .F. while ValidStr(upper("Silvio")) will return .T:

Just adjust validchars to your needs

HTH

Silvio

>I need to check names and addresses for invalid characters. What do you guys think is the best command/function to use for this. Thanks for your help.
>Marcus.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform