Skip to content

capitalize

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

string 的第一个字符转换为大写,其余字符转换为小写。

¥Converts the first character of string to upper case and the remaining to lower case.

新增于

¥Since

3.0.0

参数

¥Arguments

  1. [string=''] (字符串):要转换的字符串。

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

返回

¥Returns

(字符串):返回大写字符串。

¥(string): Returns the capitalized string.

示例

¥Example

js
_.capitalize('FRED');
// => 'Fred'

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