Created
October 10, 2016 00:50
-
-
Save ikwattro/e0bc4407427cd57c567d75a8f0a3f9a1 to your computer and use it in GitHub Desktop.
[Cypher] Split class name based on camelCase structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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