Skip to content

kebabCase ​

js
_.kebabCase([string=''])

将 string 转换为 kebab 大小写。

¥Converts string to kebab case.

新增于 ​

¥Since

3.0.0

参数 ​

¥Arguments

  1. [string=''] (字符串):要去毛刺的字符串。

    ¥[string=''] (string): The string to convert.

返回 ​

¥Returns

(字符串):返回 kebab 大小写的字符串。

¥(string): Returns the kebab cased string.

示例 ​

¥Example

js
_.kebabCase('Foo Bar');
// => 'foo-bar'

_.kebabCase('fooBar');
// => 'foo-bar'

_.kebabCase('__FOO_BAR__');
// => 'foo-bar'

Lodash v4.17 中文网 - 粤ICP备13048890号