Add polyfill for .trim
This commit is contained in:
parent
969c94d473
commit
2749957d6d
@ -14,3 +14,9 @@ String.prototype.splitOnce = function (delimiter) {
|
||||
var components = this.split(delimiter);
|
||||
return [components.shift(), components.join(delimiter)];
|
||||
};
|
||||
|
||||
if (!String.prototype.trim) {
|
||||
String.prototype.trim = function () {
|
||||
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user