toProperCase
function toProperCase(value: string, options: ToProperCaseOptions = {}): string;
Word boundaries are those of a regular expression, so "hello WORLD" becomes "Hello World". Punctuation and separators are left exactly where they were.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The string to convert. It must not be empty. |
|
|
|
Returns
string — the converted string.
Throws
Exception | Condition |
|---|---|
| the value is not a string, or is empty. |
Examples
Converting
toProperCase("hello WORLD"); // => "Hello World"
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.