Skip to content

Instantly share code, notes, and snippets.

@ikwattro
Created October 10, 2016 00:50
Show Gist options
  • Select an option

  • Save ikwattro/e0bc4407427cd57c567d75a8f0a3f9a1 to your computer and use it in GitHub Desktop.

Select an option

Save ikwattro/e0bc4407427cd57c567d75a8f0a3f9a1 to your computer and use it in GitHub Desktop.
[Cypher] Split class name based on camelCase structure
WITH "RequestMappingException.java" AS class
WITH split(split(class, ".")[0], "") as stringArray
WITH
stringArray,
filter(x IN range(0, size(stringArray)-1) WHERE stringArray[x] =~ "[A-Z]") + size(stringArray) as uppers
UNWIND range(1, size(uppers)-1) AS i
RETURN reduce(text="", x IN range(uppers[i-1], uppers[i]-1) | text + stringArray[x])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment