How trim?

Buster wouter.abraham at scarlet.be
Sat Oct 22 22:13:45 EDT 2005


On 23 Oct 2005, at 03:17, Ken Ray wrote:

-snip-

> So this next version is the fastest approach I've found that  
> accommodates
> everything:
>
> function Trim what
>   if the platform is "MacOS" then
>     replace numToChar(202) with " " in what
>   else
>     replace numToChar(160) with " " in what
>   end if
>   return (word 1 to -1 of what)
> end Trim


The above function will also replace hard spaces from the whole string.

But what about this way (strips spaces and hard spaces from beginning  
and end):

function Trim what
   return token 1 to -1 of what
end Trim

Greetings,
Wouter



More information about the use-livecode mailing list