Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing extra spaces and limiting input to A-Z, 1-0, an
Message
 
 
À
04/10/2006 13:19:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01159441
Message ID:
01159480
Vues:
17
>I am writing an applications where I want to:
>
>1. remvoe extra spaces between words, i.e. "xxx yyy" becomes "xxx yyy" and that the input is only A-Z and 0-9 (i.e. no specail characters)
>

Use reduce function from foxtools.fll, e.g.
set library to foxtools.fll
myString = reduce(m.myString)

>2. the input hast the format "xxx.yyy.ccc.etc) where "xxx", "yyy", "ccc", etc can only A-Z, 0-9, last character cannot be a period, and first character of "xxx", "yyy", "ccc", etc is A-Z.
>
lcAllowedChars = "ABCD....abcd...123..."
lcOriginalString = lcString
lcString = chrtran(lcString,lcAllowedChars,"")
lcCorrectString = chrtran(lcOriginalString,lcString,"")
>My questions are how to best remove the extra spaces and how check that only A-Z and 0-9 are entered.
>
>TIA
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform