DEV Community

ouryperd
ouryperd

Posted on

2 1

Easiest way to truncate a string in Groovy

The fastest way to truncate a string to a certain length:

assert "abcdefghij".take(5) == "abcde"

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay