How to remove leading and trailing spaces from a string?

Sadhu Nadesan sadhu at castandcrew.com
Wed May 13 14:06:26 EDT 2009


Hola Jim,

Ok, mahalo.  That looks nice.  Thanks for the info.  Thanks also to 
someone else (Phil?) who sent that.   I'm using the trimWS function as I 
found it first and it's working great as is, so I don't figure on 
changing it.  However, more info, more options, more knowledge is 
better.  The trimWS  one line of code is nice too!   Da Kine. It does 
make sense to me, and I like regular expressions, use them with sed and 
VI, etc. ... been working on Unix systems for about 25 years now, so it 
didn't look mysterious or anything.

But again, I appreciate your kindness and aloha spirit in responding.

Gratefully,
Sadhu



>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 12 May 2009 14:26:43 -1000
> From: "Jim Bufalini" <jim at visitrieve.com>
> Subject: RE: How to remove leading and trailing spaces from a string?
> To: "'How to use Revolution'" <use-revolution at lists.runrev.com>
> Message-ID: <000d01c9d361$7e764b60$7b62e220$@com>
> Content-Type: text/plain;	charset="US-ASCII"
>
> Hi Sadu,
>
> If it is just leading and trailing chars of the entire string of words or
> items or..., you can use:
>
> Put word 1 to -1 of tString into tString. 
>
> If it's a string of items use item 1 to -1...
>
> This removes spaces and other "non-word" chars before word 1 and after word
> -1. And it's quick.
>
> Aloha from Hawaii
>
> Jim Bufalini
>
>   
>



More information about the use-livecode mailing list