Skip to content

Function: titleCase() ​

ts
function titleCase(value): string;

Converts a string to Title Case. 将字符串转换为 Title Case。

Parameters ​

ParameterTypeDescription
valuestringThe source string / 源字符串

Returns ​

string

The title-cased string / 转换后的 Title Case 字符串

Example ​

ts
titleCase('hello world')
// => 'Hello World'

Since ​

1.2.0

Released under the MIT License.