Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRIM() that gets newline characters
Message
 
To
31/03/1999 10:35:20
Tim Hockin
Illinois State U - Residential Computing
Normal, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00203851
Message ID:
00203904
Views:
15
Tim,

Try something like this (it is not heavily tested so you may need to do some debugging);
LPARAMETERS pcString
pcString = TRIM(pcString)
LOCAL lnCnt, lcChar
FOR lnCnt = LEN(pcstring)-1 to 0 STEP -1
	lcChar = SUBSTR(pcString,lnCnt,1)
	IF lcChar = CHR(13) OR ;
           lcChar = CHR(10) or ;
           lcChar = " " or ;
           lcChar = CHR(9)
		pcString = LEFT(pcString,LEN(pcString)-1)
	ELSE
		EXIT
	ENDIF
ENDFOR
RETURN pcString
Previous
Reply
Map
View

Click here to load this message in the networking platform