Skip to content

Instantly share code, notes, and snippets.

@rgrove
Created October 5, 2010 00:28
Show Gist options
  • Save rgrove/610725 to your computer and use it in GitHub Desktop.
Save rgrove/610725 to your computer and use it in GitHub Desktop.
L.trimLeft = String.prototype.trimLeft ? function (s) {
return s.trimLeft();
} : function (s) {
return s.replace(/^\s+/, '');
};
L.trimRight = String.prototype.trimRight ? function (s) {
return s.trimRight();
} : function (s) {
return s.replace(/\s+$/, '');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment