To Title Case

Converts a string to title case.

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

Example

  • Input

    toTitleCase('hello world')

    Output:

    'Hello World'

Return

Returns the title-cased string.

Type: string

Props

NameTypeDefaultRequiredDescription
strstringnullYesThe string to convert to title case.

Notes

This function capitalizes the first letter of each word in the string.

Tags

  • string
  • titleCase
  • conversion

Related