Skip to content

toUpper ​

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

将 string 作为一个整体转换为大写,就像 String#toUpperCase 一样。

¥Converts string, as a whole, to upper case just like String#toUpperCase.

新增于 ​

¥Since

4.0.0

参数 ​

¥Arguments

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

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

返回 ​

¥Returns

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

¥(string): Returns the upper cased string.

示例 ​

¥Example

js
_.toUpper('--foo-bar--');
// => '--FOO-BAR--'

_.toUpper('fooBar');
// => 'FOOBAR'

_.toUpper('__foo_bar__');
// => '__FOO_BAR__'

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