Groovy web console

subscribe to the feed Subscribe
to this
site

capitalized-words

Published 1 month ago by Anonymous
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def git_user_name = "pablo.garcia.escobar@logmein.com".replace('@logmein.com', '').replace('.', ' ')

println "${git_user_name}".split(' ').collect{ it.capitalize() }.join(' ')
// VS
println git_user_name.replaceAll(/(?=\b)\S/, { it.capitalize() })