Groovy substring

Can't imagine any terser way of doing this than

println "teststring"[4..6]

Ain't it groovy :)

1 comment:

Saager Mhatre said...

try these too ;)

println 'teststring'[4..-1]
println 'teststring' - 'test'

- d