Java String Starts Wtih startsWithAny(String stringToMatch, String... stringToCheckEquals)

Here you can find the source of startsWithAny(String stringToMatch, String... stringToCheckEquals)

Description

starts With Any

License

Apache License

Declaration

public static boolean startsWithAny(String stringToMatch,
            String... stringToCheckEquals) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean startsWithAny(String stringToMatch,
            String... stringToCheckEquals) {
        for (final String candidate : stringToCheckEquals) {
            if (stringToMatch.startsWith(candidate)) {
                return true;
            }//from w  ww . ja  v a  2 s  .c  o  m
        }
        return false;
    }
}

Related

  1. startsWithAndHasMore(String input, String toStartWith)
  2. startsWithAny(String _str, String... _startStrings)
  3. startsWithAny(String s, String... options)
  4. startsWithAny(String source, String[] checks)
  5. startsWithAny(String str, String... args)
  6. startsWithAny(String text, String... prefixes)
  7. startsWithAny(String toMatch, String... startsWithAny)
  8. startsWithAnyCI(String string, String... prefixes)
  9. startsWithAnyCS(String str, String[] needles)