RosettaCodeData/Task/Substring-Top-and-tail/Groovy/substring-top-and-tail-1.groovy
2023-07-01 13:44:08 -04:00

2 lines
92 B
Groovy

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