Capitalize

Capitalizes the first letter of a string.

CategoryStrings
AuthorPol Gubau
Since1.0.0
Last Updated2025-03-15
TypeSync
CompatibilityUniversal

Example

  • Input

    capitalize('hello world')

    Output:

    'Hello world'

Return

Returns the string with the first letter capitalized.

Type: string

Props

NameTypeDefaultRequiredDescription
strstringnullYesThe string to capitalize.

Notes

This function only capitalizes the first letter of the string, leaving the rest intact.

Tags

  • string
  • capitalize
  • conversion

Related