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:
00004332
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
>mike,
>
>id say that chris deserves the VP award (your improvements were not specified in original requirements)! good one chris! elegant even!


Lucien,
Thanks for the kind words.

I am suprised, however, that no one BUSTED ME on the
fact that you don't really have to check for an
EMPTY() string in the DO WHILE!

Chris
Chris
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform