Lodash - startCase 方法

语法

_.startCase([string=''])

将字符串转换为起始大小写。

参数

  • [string=''] (string) − 要转换的字符串。

输出

  • (string) − 返回起始大小写字符串。

示例

var _ = require('lodash');
var result = _.startCase('foo bar');

console.log(result);

将上述程序保存在tester.js中。运行以下命令执行该程序。

命令

\>node tester.js

输出

Foo Bar

lodash_string.html