Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bherrmann7/329636 to your computer and use it in GitHub Desktop.
Save bherrmann7/329636 to your computer and use it in GitHub Desktop.
// 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