Javascript Trim String

2008 December 23

You can find this or something similar nearly anywhere by simply googling it, the only reason why i’m blogging this is so I don’t have to google it. So, here it is, the javascript trim string function.

function TrimString(str) {
return str.replace(/^\s+|\s+$/g, '');
}

.matti

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS