If I have a string in Groovy like so...
'user.company.name'
... and I want to get the the word "company" and "name" from that string, what is the best way to go about it?
I was thinking of something like this, but I'm not sure if it's the most efficient/groovy way:
def items = 'user.company.name'.tokenize('.')
def company = items[-2]
def name = items[-1]
Is there a better way to do this?