Skip to main content

text.camelCase

Description​

Converts a string to camelCase format by removing non-alphanumeric characters and capitalizing the first letter of each word except the first.

Syntax​

flex.text.camelCase(string)

Parameters​

ParameterTypeRequiredDescription
stringstringYesThe string to convert to camelCase

Returns​

Type: string

The input string converted to camelCase format. Returns null if input is null.

Examples​

Example 1: Basic Usage​

RETURN flex.text.camelCase('hello world') AS result

Output:

result
----------
helloWorld

Example 2: Converting Field Names​

RETURN flex.text.camelCase('user_first_name') AS result

Output:

result
-------------
userFirstName

Example 3: Normalizing Property Names​

WITH ['first-name', 'last_name', 'Email Address'] AS fields
UNWIND fields AS field
RETURN field AS original, flex.text.camelCase(field) AS camelCase

Notes​

  • Returns null for null input
  • Removes all non-alphanumeric characters
  • First character is always lowercase
  • Subsequent words start with uppercase
  • Useful for normalizing field names to JavaScript/JSON conventions

See Also​