Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you remove blanks within a field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00131900
Message ID:
00132013
Vues:
14
>Is there a quick way to remove blanks within a field? For example PART NUMBER = 'TRG 011 4TGH 77K' to become 'TRG0114TGH77K'
>Thanks.

Hi Timothy,

Everyone's told you that using STRTRAN() is the solution to your problem, and, of course, they're right. I thought I'd give you another, related piece of advice about the function. I can't recommend your using a literal string here. It can make it hard to read. I'd suggest using either:

lcnewstring = STRTRAN(yourstring, SPACE(1), "")

or

lcreplace = SPACE(1)
lcnewstring = STRTRAN(yourstring, lcreplace, "")

It's much more readable, and, therefore, maintainable.

BTW, the third parameter isn't necessary. If it's eliminated STRTRAN() replaces the specified character with a "" anyway.

hth,
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