Skip to content

removeEndingSlash

Simple helper that removes an ending slash / if present.

Available since v1.0.1

import { removeEndingSlash } from '@helpers4/url';
removeEndingSlash(url: string): string
ParameterTypeDescription
urlstringA valid URL.

string — The URL without its trailing slash.

removeEndingSlash('https://www.google.com/');
// => 'https://www.google.com'

View on npm