Skip to content

Instantly share code, notes, and snippets.

@grasGendarme
Created August 8, 2013 09:54
Show Gist options
  • Save grasGendarme/6183320 to your computer and use it in GitHub Desktop.
Save grasGendarme/6183320 to your computer and use it in GitHub Desktop.
String.prototype.removeTrailing = function(what) {
if(this.slice(-what.length) === what) {
return this.slice(0, -what.length);
} else {
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment