add String.prototype.trim
This commit is contained in:
parent
e47f826329
commit
e480d87b34
1 changed files with 7 additions and 0 deletions
|
@ -118,3 +118,10 @@ if (!Object.keys) {
|
|||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
// see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim
|
||||
if (!String.prototype.trim) {
|
||||
String.prototype.trim = function() {
|
||||
return this.replace(/^\s+|\s+$/g, '');
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue