Function removeLeadingSlash

Removes the leading slash from the beginning of the segment (if it exists)

const segment = removeLeadingSlash('/example');

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

    • segment: string

    Returns string