TRIM command? - reply #2

mfstuart at cox.net mfstuart at cox.net
Thu May 18 18:55:10 EDT 2006


Thanx to all for helping. Here's my result.

After trying your quick answers to my request, 
here's what I've found to work when applying a TRIM function to text:
To those in need of this, I created a function, as you may use/call it multiple times.

-- gets the very first word and the very last word in myText variable,
-- and removes/trims the spaces before and after those words.
function trimText tText
  put word 1 to -1 of tText into myText
  return myText
end trimText

--To call the function, use the following in a mouseUp script:
      put trimText(someText) into someText



More information about the use-livecode mailing list