form-cheatsheet/src/polyfills/String.prototype.trim.js

3 lines
104 B
JavaScript
Raw Normal View History

2016-10-10 12:02:31 -04:00
String.prototype.trim = function () {
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
};