How trim?

Marielle Lange mlange at lexicall.org
Mon Oct 24 17:27:50 EDT 2005


Why did I use matchtext and replace in my previous example.... Sorry  
I was leaving you to find the solution on your own (sorry, teacher  
here)... There was obviously an obvious shortcut to take.

put BTrim("   The cat sat under the mat   " ) into tResult

function BTrim pText
     get matchtext(pText, "(^[ \t]*(.*)[ \t]*$)", tFull, tPart)
     replace tFull with tPart in pText;
     return pText
end function

Best,
Marielle

------------------------------------------------------------------------ 
--------
Marielle Lange (PhD),  Psycholinguist

Alternative emails: mlange at blueyonder.co.uk, M.Lange at ed.ac.uk
Homepage                                                            
http://homepages.lexicall.org/mlange/
Easy access to lexical databases                    http://lexicall.org
Supporting Education Technologists              http:// 
revolution.lexicall.org






More information about the use-livecode mailing list