Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.Collection;

public class Main {
    static public boolean containsCaseInsensitive(Collection<String> items, final String queryItem)
            throws IllegalArgumentException {

        if (items == null || queryItem == null) {
            throw new IllegalArgumentException();
        }

        for (String item : items) {
            if (queryItem.equalsIgnoreCase(item)) {
                return true;
            }
        }

        return false;
    }
}