Lodash - 大寫字母方法



語法

_.upperCase([string=''])

將字串(以空格分隔的單詞)轉換為大寫字母。

引數

  • [string='''] (string) - 要轉換的字串。

輸出

  • (string) - 返回大寫字母的字串。

示例

var _ = require('lodash');
var result = _.upperCase('fooBar');

console.log(result);

將以上程式儲存在 tester.js 中。執行以下命令以執行此程式。

命令

\>node tester.js

輸出

FOO BAR
lodash_string.htm
廣告位
© . All rights reserved.