Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing extra spaces in MIDDLE of str.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00535205
Message ID:
00535684
Vues:
16
Thanks. I have been wondering about that for a long time.


>>This will remove occurances of multiple spaces.
>>
>>lcStr = ALLTRIM(lcOriginalStr) && remove leading and trailing spaces
>>DO WHILE AT(" ", lcStr) > 0 && look for double space
>> lcStr = STRTRAN(lcStr, " ", " ", 1, 1) && convert double space to single
>>ENDDO
>>
>>I do not know how to get UT to not remove spaces.
>>
>Use < PRE > and < /PRE > tags like this:
lcStr = ALLTRIM(lcOriginalStr)    && remove leading and trailing spaces
>DO WHILE AT("  ", lcStr) > 0       && look for double space
>   lcStr = STRTRAN(lcStr, "  ", " ", 1, 1)  && convert double space to single
>ENDDO
If you hit the reply button, you'll see the actual tags.
Dennis Lindeman
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform