text.capitalize
Description
Capitalizes the first character of a string, converting it to uppercase while leaving the rest of the string unchanged.
Syntax
flex.text.capitalize(string)
Parameters
| Parameter | Type | Required | Description | |———–|——|———-|————-| | string | string | Yes | The string to capitalize |
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
RETURN flex.text.capitalize('hello world') AS result
Output:
result
-------------
Hello world
Example 2: Capitalizing Node Properties
MATCH (p:Person)
RETURN p.id, flex.text.capitalize(p.name) AS capitalizedName
Notes
- Returns
nullfornullinput - Returns empty string for empty string input
- Only affects the first character
- Does not change the case of subsequent characters
See Also
- text.decapitalize - Lowercase the first character
- text.camelCase - Convert to camelCase format
- text.upperCamelCase - Convert to UpperCamelCase format