string Contains Item From List - Java java.util

Java examples for java.util:List Contain

Description

string Contains Item From List

Demo Code


//package com.java2s;

public class Main {


    public static boolean stringContainsItemFromList(String inputString,
            String[] items) {//from   ww  w.j a v  a  2 s.c  om
        for (int i = 0; i < items.length; i++) {
            if (inputString.contains(items[i])) {
                return true;
            }
        }
        return false;
    }
}

Related Tutorials