将每个单词的首字母转换成大写
- Source:
Example
str.titleize('the titleize string method') // 'The Titleize String Method'
str.titleize('let\'s have some fun') // 'Let\'s Have Some Fun'
str.titleize('a-dash-separated-string') // 'A-Dash-Separated-String'
str.titleize('A-DASH-SEPARATED-STRING') // 'A-Dash-Separated-String'
Parameters:
Name | Type | Description |
---|---|---|
str |
String | 包含一个或多个单词的字符串 |
Returns:
已将每个单词的首字母转换成大写的字符串
- Type
- String