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

  • str::string
  • natural::boolean || false
    Named

Returns

string

Examples

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

Released under the MIT License