判断字符串是否为 URL slug(短路径)
输入值
是否为合法 URL slug 格式字符串
stringIsSlug('my-article-title') // truestringIsSlug('hello-world-2024') // truestringIsSlug('Hello-World') // false,大写不允许stringIsSlug('hello_world') // false,下划线不允许stringIsSlug('hello world') // false,空格不允许stringIsSlug('') // false Copy
stringIsSlug('my-article-title') // truestringIsSlug('hello-world-2024') // truestringIsSlug('Hello-World') // false,大写不允许stringIsSlug('hello_world') // false,下划线不允许stringIsSlug('hello world') // false,空格不允许stringIsSlug('') // false
判断字符串是否为 URL slug(短路径)