Skip to content

Instantly share code, notes, and snippets.

@demoth
Created December 20, 2013 18:19
Show Gist options
  • Save demoth/8059024 to your computer and use it in GitHub Desktop.
Save demoth/8059024 to your computer and use it in GitHub Desktop.
def result = ''
'russ(ai)(edocn)cup'.split('\\(').each {
result += (it.contains(')')) ? (result += it.split('\\)')[0].reverse() + (it.split('\\)').size() == 2 ? it.split('\\)')[1] : '')) : it
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment