Skip to main content

$initCapOnce

$initCapOnce(string?) -> string
Compact type signature<s-:s>

If string is omitted, the current context value is used.

Browse categories

Source: FUME

Documentation

Capitalizes only the first character of a string and leaves the rest of the value unchanged.

Unlike $initCap(), this helper does not trim whitespace or normalize later words. Undefined input returns undefined. Passing a non-string raises the same type error used by other FUME utility helpers.

Examples

Capitalize only the first character

Input

"examplecare"

Expression

$initCapOnce($)

Result

"Examplecare"