trimming ?
Rob Cozens
rcozens at pon.net
Wed Aug 21 08:52:01 EDT 2002
>>This is what I use:
>>
>>function trimText pText
>> put cr & tab & space into tTrimChars
>> repeat while char 1 of pText is in tTrimChars
>> delete char 1 of pText
>> end repeat
>> repeat while char -1 of pText is in tTrimChars
>> delete char -1 of pText
>> end repeat
>> return pText
>>end trimText
>
>Another variation I use:
>
>function trim theText
> repeat for each word w in theText
> put w & space after temp
> end repeat
> delete last char of temp
> return temp
>end trim
Dave, Jacque, et al:
If you're simultaneously stripping leading AND trailing spaces on a
single line of text, can't you just use "get word 1 to -1 of theText"?
--
Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode
mailing list