Here you can find the source of startsWithAny(String toMatch, String... startsWithAny)
Parameter | Description |
---|---|
toMatch | a String to check for matches |
startsWithAny | a parameter |
public static boolean startsWithAny(String toMatch, String... startsWithAny)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . j av a2 s.c o m * Checks if a given String starts with any of the given Strings * * @param toMatch * a String to check for matches * @param startsWithAny * @return true if the String starts with any of the given Strings */ public static boolean startsWithAny(String toMatch, String... startsWithAny) { for (String s : startsWithAny) { return toMatch.startsWith(s); } return false; } }