Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to strip out trailing blanks/CR/LFs from a stri
Message
 
 
À
19/07/2004 11:09:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00925773
Message ID:
00925795
Vues:
17
Hi Fernando,
DO WHILE INLIST(RIGHT(cString,1),CHR(32),CHR(10),CHR(13))
	cString = LEFT(cString , LEN(cString) - 1)
ENDDO
>Hi,
>
>What is the best/fastest way to remove trailing carriage returns/line feeds from a string?
>
>Example:
>
>cString = "This is what I want to keep!"                         + ;
>          Space (10) + Chr (13) + Chr (10) + Chr (13) + Chr (10) + ;
>          Space ( 1) + Chr (13) + Chr (10) + ;
>          Space ( 1)
>
>After execution of the routine, all trailing blanks/CR/LFs should be removed (last 18 characters removed, first 28 characters ketp).
>
>TIA
>
>Fernando
Regards,

Mike

"We try to solve the problem by rushing through the design process so that enough time is left at the end to uncover the errors that were made because we rushed through the design process."
- Glenford Myers

If you're going through hell, keep going. - Walt Disney
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform