Skip to main content

Description

Capitalizes the first character of a string, converting it to uppercase while leaving the rest of the string unchanged.

Syntax

Parameters

Returns

Type: string The input string with its first character converted to uppercase. Returns null if the input is null, and empty string if input is empty.

Examples

Example 1: Basic Usage

Output:

Example 2: Capitalizing Node Properties

Notes

  • Returns null for null input
  • Returns empty string for empty string input
  • Only affects the first character
  • Does not change the case of subsequent characters

See Also

Frequently Asked Questions

No. It only converts the first character to uppercase — all other characters remain exactly as they are.
It returns an empty string. For null input, it returns null.