Question: I want to check a list contains a specific string .

before checking all entries in list as well as sting should be in. lowercase

I tried like this 

```
 def venueName = params.name
 def venueNameLists = Venue.executeQuery("select name from Venue")
  if(venueNameLists.toLowerCase().contains(venueName.toLowerCase())){
            error = true;
            log.debug("save :: duplicate name")
            flash.message = "Venue name already exist";
            render(view: "create", model: [venueInstance: new Venue(params)])
            return
        }

```

gives error

```
  No signature of method: java.util.ArrayList.toLowerCase() is applicable for argument types: () values: []. Stacktrace follows:

  groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.toLowerCase() is applicable for argument types: () values: []

```

Answer: 
I agree with **aiolos**: use constraints or try to find instance by name ignore case. But to fix this your way try `*.` ([spread operator](https://groovy-lang.org/operators.html#_spread_operator)):

```
venueNameLists*.toLowerCase().contains(venueName.toLowerCase()) 

```
If you would like to check a duplicate entry before saving an element, use [constraints](http://grails.org/doc/latest/ref/Domain%20Classes/constraints.html) on your domain class. Here you could use [unique](http://grails.org/doc/latest/ref/Constraints/unique.html) constraint or implement your own if you need it [case insensitive](https://stackoverflow.com/a/2537997/1230366).

If you need to check it manually, try this:

```
def venueWithNameFromParams = Venue.findByNameIlike(params.name) // ignore case
if(venueWithNameFromParams){
    // venueName is in venueNameList
} 

```