Java - Write code to check if a string starts With Any String value from an array using variable length parameter

Requirements

Write code to starts With Any

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String stringToMatch = "book2s.com";
        String stringToCheckEquals = "book2s.com";
        System.out// w  ww  .j  a  v  a2  s.  c  o  m
                .println(startsWithAny(stringToMatch, stringToCheckEquals));
    }

    public static boolean startsWithAny(String stringToMatch,
            String... stringToCheckEquals) {
        for (final String candidate : stringToCheckEquals) {
            if (stringToMatch.startsWith(candidate)) {
                return true;
            }
        }
        return false;
    }
}