Function removeLeadingSlash

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

    Parameters

    • segment: string

    Returns string

    const segment = removeLeadingSlash('/example');

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