apoc.text.snakeCase

Details

Syntax

apoc.text.snakeCase(text)

Description

Converts the given STRING to snake case.

Arguments

Name

Type

Description

text

STRING

The string to convert to snake case.

Returns

STRING

Usage Examples

RETURN apoc.text.snakeCase("test Snake Case") AS output;
Results
output

"test-snake-case"

RETURN apoc.text.snakeCase("FOO_BAR") AS output;
Results
output

"foo-bar"

RETURN apoc.text.snakeCase("Foo bar") AS output;
Results
output

"foo-bar"

RETURN apoc.text.snakeCase("fooBar") AS output;
Results
output

"foo-bar"

RETURN apoc.text.snakeCase("foo-bar") AS output;
Results
output

"foo-bar"

RETURN apoc.text.snakeCase("Foo bar") AS output;
Results
output

"foo-bar"

RETURN apoc.text.snakeCase("Foo  bar") AS output;
Results
output

"foo-bar"