Removes the leading and trailing slash from the segment (if they exist)
const segment = removeLeadingAndTrailingSlash('/example/');console.log(segment); // 'example' Copy
const segment = removeLeadingAndTrailingSlash('/example/');console.log(segment); // 'example'
Removes the leading and trailing slash from the segment (if they exist)
Usage