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
strstring
naturalnamedbooleanfalse

named parameters are passed as named parameters in Dart and keyword arguments in Python.

Returns

string

Examples

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

Released under the MIT License