Last active
November 9, 2016 13:12
-
-
Save phcorp/2e3fa27e011fe597b70f5ff52b7391e6 to your computer and use it in GitHub Desktop.
Translating CamelCase into human readable string in PHPStorm
This file contains 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
## Format CamelCase to text | |
## fooBar => Foo bar | |
## fooBAR => Foo bar | |
## References: | |
## https://velocity.apache.org/engine/devel/user-guide.html | |
## https://www.jetbrains.com/help/phpstorm/2016.1/template-languages-velocity-and-freemarker.html | |
#set ($formattedName = $NAME) | |
#set ($formattedName = $formattedName.replaceAll('([A-Z]+)', ' $1')) | |
#set ($formattedName = $formattedName.toLowerCase()) | |
#set ($firstLetter = $formattedName.substring(0,1).toUpperCase()) | |
#set ($otherLetters = $formattedName.substring(1)) | |
#set ($formattedName = "${firstLetter}${otherLetters}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment