Created
July 28, 2020 23:48
-
-
Save cvan/038e63d48abf2b726109f79badfc34ed to your computer and use it in GitHub Desktop.
strip trailing slashes in a URL (JavaScript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stripTrailingSlashesInUrl = str => str.replace(/\/+$/g, ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment