Add polyfill for .trim

This commit is contained in:
JC Brand 2015-09-25 21:03:37 +00:00
parent 969c94d473
commit 2749957d6d

View File

@ -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, '');
};
}