The trim method returns the string stripped of whitespace from both ends.
string.trim()
If the trim function it's not natively available, the following code will create it:
if (!String.prototype.trim) { String.prototype.trim = function () { return this.replace(/^\s+|\s+$/gm, ''); }; }
With jquery it's very easy:
$.trim()
No comments:
Post a Comment