Skip to content

capitalize

Convert a string to a capitalized format

152 bytes

Usage

Given a string returns it with the first letter upper cased and all other letters lower cased.

import * as
import _
_
from 'radashi'
import _
_
.
function capitalize(str: string): string
export capitalize

Capitalize the first word of the string.

@seehttps://radashi.js.org/reference/string/capitalize

@example

capitalize('hello') // => 'Hello'
capitalize('one two three') // => 'One two three'

@version12.1.0

capitalize
('green fish blue FISH') // => Green fish blue fish