Skip to content

capitalize

capitalize(string) → string · String

Capitalize the first letter of a string. Only affects the first character.

  • string (required): the string to capitalize
utlx
capitalize("hello world")               // "Hello world"
capitalize("HELLO")                      // "HELLO" (already uppercase — no change)
capitalize("")                           // ""

Released under AGPL-3.0.