This snippet will give you the Trim functions for Javascript.
Sample Javascript
String.prototype.ltrim = function () {
return this.replace(/^\s+/, '');
}
String.prototype.rtrim = function () {
return this.replace(/\s+$/, '');
}
String.prototype.trim = function () {
return this.ltrim().rtrim();
}
RT @CodeSnippetsNET: Trim functions for #Javascript http://t.co/q7eMg0kZXn #js #php #html #code #coding #programming #dev
RT @CodeSnippetsNET: Trim functions for #Javascript http://t.co/q7eMg0kZXn #js #php #html #code #coding #programming #dev