Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trim function to remove blanks + returns
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00004308
Message ID:
00004327
Vues:
37
>FUNCTION NoCr(tcString)
>tcString = ALLTRIM(tcString)
>DO WHILE RIGHT(tcString,1) = CHR(13) AND !EMPTY(tcString)
> tcString = SUBSTR(tcString,1,LEN(tcString)-1)
>ENDDO
>RETURN tcString

Thanks. I changed a few things.

FUNCTION NoCr(tcString)
tcString=ALLTRIM(tcString)
DO WHILE INLIST(RIGHT(tcString,1),CHR(13),CHR(10),CHR(160)) AND NOT EMPTY(tcString)
tcString=ALLTRIM(SUBSTR(tcString,1,LEN(tcString)-1))
ENDDO
RETURN tcString
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform