capitalize
stringConverts the first character of string to upper case and the remaining to lower case.
Signature
capitalize(str: string): stringParameters
| Name | Type | Description |
|---|---|---|
str | string | The string to capitalize |
Returns
string - Returns the capitalized string
Examples
Basic Usage
import { capitalize } from 'dashlite'
const result = capitalize('hello')
console.log(result)Output:
HelloAll Caps
import { capitalize } from 'dashlite'
const result = capitalize('HELLO WORLD')
console.log(result)Output:
Hello worldAvailable since version 1.0.0