|
|
If you need to simulate
@Trim (formula) / fulltrim (LotusScript) in JavaScript (string-only),
you can do so with the following function using regular expressions:
function trim(txt)
{
return txt.replace(/(^ +|
+\$)/g,'').replace(/ +/g, ' ');
}
About the Author Marcus Foerster works
as Systems Architect for Pentos AG in Munich, Germany. His focus lies
on the application side, creating collaboration systems for users,
groups and enterprises to get their daily work done. This approach
includes integrating complex workflows with intuitive user interfaces,
using Lotus Notes/Domino with Adobe Flex and other Web technologies. Read more in Marcus' blog: http://marcus.foerster.com/blog |