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 {
    public static boolean containsStringIgnoreCase(Collection<? extends String> strings, String string) {
        if (strings == null) {
            throw new NullPointerException("strings == null");
        }

        if (string == null) {
            throw new NullPointerException("string == null");
        }

        for (String s : strings) {
            if (string.equalsIgnoreCase(s)) {
                return true;
            }
        }

        return false;
    }
}