Quicktip: @Trim in JavaScript
Just needed this one - thought you might find it helpful as well, so I am blogging it:
If you need to simulate @Trim (formula) / fulltrim (Lotusscript) in JavaScript (string-only), you can do so with the following function using regular expressions:
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, ' ');
}
return txt.replace(/(^ +| +$)/g,'').replace(/ +/g, ' ');
}




Last seen at...
1 Comments:
If you need some more @Functions in JS -> http://www.breakingpar.com/bkp/home.nsf/Doc!OpenNavigator&1DB402EE745E8AE687256E4C006F8D59&Remote
Have a great weekend!
Post a Comment
Thank you for your comment. It will be published shortly. Keep having a great day!
<< Home