Multiple Line SQL for MySQL?
Sarah Reichelt
sarahr at genesearch.com.au
Tue Mar 29 18:11:12 EST 2005
Hi Peter,
I use an alternative trim function that operates faster and removes
excess space between words as well as at the start & end:
function trim pText
put empty into tNew
repeat for each word w in pText
put w & space after tNew
end repeat
delete last char of tNew
return tNew
end trim
Cheers,
Sarah
On 29/03/2005, at 7:33 PM, Peter Reid wrote:
> function trimmed theText
> -- remove leading & trailing spaces
> put 1 into startCh
> put length(theText) into lenText
> put lenText into endCh
> repeat for each char c in theText
> if c <> space then
> exit repeat
> end if
> add 1 to startCh
> end repeat
> repeat with c = lenText to startCh step -1
> if char c of theText <> space then
> put c into endCh
> exit repeat
> end if
> end repeat
> return char startCh to endCh of theText
> end trimmed
More information about the use-livecode
mailing list