Skip to content

upperFirst ​

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

将 string 的第一个字符转换为大写。

¥Converts the first character of string to upper case.

新增于 ​

¥Since

4.0.0

参数 ​

¥Arguments

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

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

返回 ​

¥Returns

(字符串):返回转换后的字符串。

¥(string): Returns the converted string.

示例 ​

¥Example

js
_.upperFirst('fred');
// => 'Fred'

_.upperFirst('FRED');
// => 'FRED'

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