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
De
04/10/2006 14:37:39
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
 
À
04/10/2006 14:18:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01159441
Message ID:
01159485
Vues:
19
>>>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)
>>>
>>>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.
>>>
>>>My questions are how to best remove the extra spaces and how check that only A-Z and 0-9 are entered.
>>>
>>>TIA
>>
>>Claude,
>>
>>For removing extra spaces, this should do the trick.
>>
>>cString = "xxx  yyy  zzz"
>>cString = STRTRAN(cString,SPACE(2),SPACE(1),1,OCCURS(SPACE(2),cString))
>>
>>Regards,
>
>Thanks the problem I have is that I do not know how many space thee are between "x" and "y". so that I want "x y", 'x y", "x y", "x y" all to return "x y". The above only works if there are exacty two spaces between x and y.

Right. See my reply to Don, Message#1159464, for a possible solution.

Regards,
Jim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform