用法
removeLeadingSlash 函数用于移除 URL 的开头斜杠。
import { removeLeadingSlash } from '@movk/core'
removeLeadingSlash('/path/to/page') // 'path/to/page'
removeLeadingSlash('///path') // 'path'
removeLeadingSlash('path') // 'path'
API
removeLeadingSlash(url)
移除 URL 的开头斜杠。
参数
url
string required
URL 或路径字符串。
返回值
返回值
string
移除开头斜杠后的字符串。
Changelog
No recent changes