Skip to content

capitalizeEachWords

Converts every word with spaces to uppercase. If the naturally argument is true, only some special cases (such as prepositions) are kept lowercase.

Parameters

NameTypeRequiredDefault
strstringStringstr
naturalnamedkeywordbooleanboolfalseFalse

namedThese parameters are passed as named parameters.

keywordThese parameters are passed as keyword arguments, or as a single dict in their place.

Returns

string

String

str

Examples

javascript
capitalizeEachWords('abcd'); // Returns 'Abcd'
dart
capitalizeEachWords('abcd'); // Returns 'Abcd'
python
capitalizeEachWords('abcd')  # Returns 'Abcd'

Released under the MIT License