apoc.text.snakeCase

Function APOC Core

apoc.text.snakeCase(text) YIELD value - Convert a string to snake-case

Signature

apoc.text.snakeCase(text :: STRING?) :: (STRING?)

Input parameters

Name Type Default

text

STRING?

null

Usage Examples

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

"test-snake-case"

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

"foo-bar"

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

"foo-bar"

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

"foo-bar"

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

"foo-bar"

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

"foo-bar"

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

"foo-bar"