DEV Community

ouryperd
ouryperd

Posted on

Easiest way to truncate a string in Groovy

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

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

Latest comments (0)