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:
00535668
Vues:
14
>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.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform