Function removeTrailingSlash

Removes the trailing slash from the end of the segment (if it exists)

const segment = removeTrailingSlash('example/');

console.log(segment); // 'example'
  • Parameters

    • segment: string

    Returns string