Groovy web console

subscribe to the feed Subscribe
to this
site
Username demo (via #groovywebconsole)
tweet this snippet Tweet
this
script

Username demo

Published 10 months ago by Josh Hyde
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def cfValue = 'Joshua Hyde';
def cfUserNameFirst = cfValue.substring(0, 1);
def spacePos = cfValue.indexOf(' ');
def cfUserNameLast = cfValue.substring(spacePos + 1);
def cfUserNameFull = cfUserNameFirst + cfUserNameLast;
System.out.println(cfUserNameFull);