Here you can find the source of startsWithAny(String _str, String... _startStrings)
Parameter | Description |
---|---|
_str | string to check |
_startStrings | start strings to compare |
public static boolean startsWithAny(String _str, String... _startStrings)
//package com.java2s; //License from project: Open Source License public class Main { /**//from www . j a v a2 s.c o m * Checks if given String starts with any of the other given parameters. * * @param _str string to check * @param _startStrings start strings to compare * @return true if any match, false otherwise */ public static boolean startsWithAny(String _str, String... _startStrings) { if (_str == null || _startStrings == null || _startStrings.length == 0) { return false; } for (String start : _startStrings) { if (_str.startsWith(start)) { return true; } } return false; } }