Skip to content

upperFirst ​

Uppercase the first character of a string and leave the rest unchanged.

Usage ​

ts
import { upperFirst } from '@maz-ui/utils'

upperFirst('hello') // → 'Hello'
upperFirst('hELLO') // → 'HELLO'
upperFirst('') // → ''

API ​

ts
function upperFirst(value: string): string
ParameterTypeDescription
valuestringThe string to process

Notes ​

  • Does not lowercase the remaining characters — use capitalize for the same behaviour when you control the input shape.