TRIM command?

Gary S. garyshow at verizon.net
Fri May 19 17:15:16 EDT 2006


I don't claim to be a regular expression expert (just a long time  
list lurker), but I recently had the same need for a trim command and  
came up with this function:

function trimWS pText
   -- Remove all leading and trailing whitespace characters.
   -- I.E., space, tab, carriage return, line feed, form feed.

   return replaceText(pText,"(^\s+)|(\s+$)",empty)

end trimWS


Gary




More information about the use-livecode mailing list