Skip to content

Instantly share code, notes, and snippets.

@cvan
Created July 28, 2020 23:48
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 cvan/038e63d48abf2b726109f79badfc34ed to your computer and use it in GitHub Desktop.
Save cvan/038e63d48abf2b726109f79badfc34ed to your computer and use it in GitHub Desktop.
strip trailing slashes in a URL (JavaScript)
const stripTrailingSlashesInUrl = str => str.replace(/\/+$/g, '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment