RosettaCodeData/Task/Substring-Top-and-tail/Groovy/substring-top-and-tail-1.groovy
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

2 lines
92 B
Groovy

def top = { it.size() > 1 ? it[0..-2] : '' }
def tail = { it.size() > 1 ? it[1..-1] : '' }