Created
March 11, 2010 20:49
-
-
Save bherrmann7/329636 to your computer and use it in GitHub Desktop.
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
// input: someGroovyCodeToTakeCamelCaseAndMakeItNicer | |
// output: Some Groovy Code To Take Camel Case And Make It Nicer | |
def str = 'someGroovyCodeToTakeCamelCaseAndMakeItNicer'.collect { | |
(Character.isUpperCase(it as char)?' ':'') + it | |
}.join() | |
str = str[0].toUpperCase() + str[1..-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment