Word 1 to -1 Truncating Entire Paragraphs?

Sivakatirswami katir at hindu.org
Fri Nov 11 19:21:30 EST 2005


There are  commas in the text that is chopped off, so it's not a  
delimiter issue. I don't have time to debug it and on the WHEW  
(WHatEverWorks) principle I'll just use this function which *does*  
work on the same text chunk. I don't think the extra CPU time is an  
issue. (except to nano bots)

Thanks Ken!

Sivakatirswami



On Nov 11, 2005, at 1:21 PM, Ken Ray wrote:

>  function trim what
>   if the platform is "MacOS" then put numToChar(202) into tHardSpc
>   else put numToChar(160) into tHardSpc
>   put (space & tab & cr & linefeed & tHardSpc) into tWhiteSpc
>   repeat
>     if char 1 of what is not in tWhiteSpc then exit repeat
>     else delete char 1 of what
>   end repeat
>   repeat
>     if char -1 of what is not in tWhiteSpc then exit repeat
>     else delete char -1 of what
>   end repeat
>   return what
> end trim




More information about the Use-livecode mailing list