Java List Contain containsStringStartingWith(List list, String prefix)

Here you can find the source of containsStringStartingWith(List list, String prefix)

Description

contains String Starting With

License

Open Source License

Parameter

Parameter Description
list a parameter
prefix a parameter

Return

true indien de lijst met strings minimaal 1 string bevat die met de gegeven prefix begint.

Declaration

public static boolean containsStringStartingWith(List<String> list, String prefix) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    /**//from w w w  . j  a  va2 s .c o  m
     * @param list
     * @param prefix
     * @return true indien de lijst met strings minimaal 1 string bevat die met de gegeven
     *         prefix begint.
     */
    public static boolean containsStringStartingWith(List<String> list, String prefix) {
        for (String s : list) {
            if (s.startsWith(prefix))
                return true;
        }
        return false;
    }
}

Related

  1. containsOnlySequentialNumbers(List values)
  2. containsOrIsEmpty(List list, Object item)
  3. containsReference(List references, Object toBeFound)
  4. containsSameItemsInOrder(List col1, List col2)
  5. containsStr(List list, String str)
  6. containsSubsequence(List a, List b)
  7. containsType(List list, Class type)
  8. containsUnorderedSequence(List a, List b)
  9. containsUsingToArray(List list, Integer value)