Stripping blank spaces before and after a word

Jim Ault JimAultWins at yahoo.com
Thu Nov 2 17:56:55 CST 2006


> from before and after the contents
was the original request.  Unfortunately your script would delete all
spaces, not just line ending and beginning, phrase ending and beginning, and
those between quotes, such as " 60W light bulb"

That's why using "word 1 to -1 of containerText" does the job, or

word 1 to -1 of line x of field description.

Jim Ault
Las Vegas

On 11/2/06 1:10 PM, "Stgoldberg at aol.com" <Stgoldberg at aol.com> wrote:

> A simple script to accomplish the removal of blank spaces (in field
> "datafield") is as follows:
> 
> repeat with x = 1 to the number of chars in field "datafield"
>      if char x of field "datafield" is " " then delete char x of field
> "datafield"
>    end repeat
> 
> Steve Goldberg
> 
> In a message dated 11/2/06 1:02:47 PM,
> use-revolution-request at lists.runrev.com writes:
> 
> 
>> Does anyone have a handy little script that could be put in a
>>>> repeat loop to evaluate either the contents of several fields, or a
>>>> comma delimitered list of variables, and strip any blank spaces
>>>> that may or may not exist from before and after the contents. To
>>>> ready the data for insertion into a database.  I am having an issue
>>>> with data being entered with spaces before of after the words,  and
>>>> then not showing up in a data query because of that.
>>>>    I usualy insert the datra from several fields into a list such as
>>>>    var1,var2,var3, etc before entering it into a database.





More information about the use-livecode mailing list