Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    /***
     * Case insensitive check if the collection contains the string.
     * @param collectionThe collection of objects, only strings are checked
     * @param match String to match
     * @return true, if match contained in the collection
     */
    protected static boolean caseInsensitiveContains(ArrayList collection, String match) {
        for (Object obj : collection) {
            String str = (String) obj;
            if (str != null) {
                if (str.equalsIgnoreCase(match)) {
                    return true;
                }
            }
        }

        return false;
    }
}