Groovy – How to compare the string? January 6, 2023 by Tarik This should be an answer str2.equals( str ) If you want to ignore case str2.equalsIgnoreCase( str )