Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created November 27, 2017 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seogi1004/ce37c4ac1fd821e5a6142ed2eb2ef2aa to your computer and use it in GitHub Desktop.
Save seogi1004/ce37c4ac1fd821e5a6142ed2eb2ef2aa to your computer and use it in GitHub Desktop.
var sObj = new String(" Prototype Test ");
sObj.trim = function() {
return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""));
};
sTxt = sObj.trim();
alert("--" + sTxt + "--");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment