Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stripping space from strings
Message
De
25/11/1996 23:51:28
 
 
À
25/11/1996 19:27:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00013477
Message ID:
00013492
Vues:
31
>How do I strip out extra spaces and carriage returns and line feeds from character strings that are in memo fields?

Here's a fantastic NoCr() function.
FUNCTION NoCr(tcString)
tcString=ALLTRIM(tcString)
DO WHILE INLIST(LEFT(tcString,1),CHR(13),CHR(10),CHR(160)) AND LEN(tcString)>0
   tcString=SUBSTR(tcString,2)
ENDDO
DO WHILE INLIST(RIGHT(tcString,1),CHR(13),CHR(10),CHR(160)) AND LEN(tcString)>0
   tcString=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