Java String Ends With endsWithAny(String stringToMatch, String... stringToCheckEquals)

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

Description

ends With Any

License

Apache License

Declaration

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

Method Source Code

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

public class Main {
    public static boolean endsWithAny(String stringToMatch,
            String... stringToCheckEquals) {
        for (final String candidate : stringToCheckEquals) {
            if (stringToMatch.endsWith(candidate)) {
                return true;
            }/*from  w w w.ja  v  a  2 s  . co  m*/
        }
        return false;
    }
}

Related

  1. endsWith(StringBuilder sb, String suffix)
  2. endsWith3(String string, int char1, int char2, int char3)
  3. endsWithAny(final byte[] str, int startIndex, int endIndex, final byte... chars)
  4. endsWithAny(String str, String... args)
  5. endsWithAny(String string, String searchStrings[])
  6. endsWithAnyCI(String string, String... suffixes)
  7. endsWithAnyIC(String str, String[] needles)
  8. endsWithBackslash(final String s)
  9. endsWithChar(CharSequence s, char suffix)