string

4 posts

How to generate a random password in Groovy?

Sometimes you need to generate a random password (or just random string of any kind.) Today I will show you how to do it with a single line of code in Groovy 3 (or newer.)

Groovy 3 String GDK improvements - takeRight, takeBetween, and a few others

Groovy 3 was released a few days ago[1], and it introduced a lot of important new features to the language. Today I want to show you a few useful improvements in the GDK. We will take a closer look into methods like takeRight, takeAfter, takeBetween, and a few others that were added to the java.lang.String class.

Three Groovy String methods that will make your life Groovier!

Groovy String API offers many useful methods to make working with strings much more pleasant. Today I would like to show you three, not so very popular, yet convenient methods. Let’s jump straight into it!

Groovy: split string and avoid getting IndexOutOfBoundsException

If you use Groovy for scripting or other similar tasks you probably faced a situation where you get an input as a text and you need to process it e.g. split by some delimiter and continue working with extracted values. In this post I will show you how to do it in 3 different ways.