Lodash - toUpper 方法



語法

_.toUpper([string=''])

將字串整體轉換為大寫,就像 String#toUpperCase 一樣。

引數

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

輸出

  • (字串) - 返回轉換後的字串。

示例

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

console.log(result);

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

命令

\>node tester.js

輸出

FOOBAR
lodash_string.htm
廣告
© . All rights reserved.