Here you can find the source of containsStringStartingWith(List
Parameter | Description |
---|---|
list | a parameter |
prefix | a parameter |
public static boolean containsStringStartingWith(List<String> list, String prefix)
//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; } }