Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stripping space from strings
Message
 
To
25/11/1996 23:51:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00013477
Message ID:
00013515
Views:
29
>>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
>
or mystring = strtran(mystring,chr(13)+chr(10),'')
etc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform