Count the number of consonants in a string.

public class Test {

    public static void main(String[] args) {
        String str = "Ironman Spiderman Thor BlackWidow Captain-America";

        System.out.println("number of consonants in '" + str + "' is : " + consonantsCount(str));
    }

    private static int consonantsCount(String str) {
        int count = 0;
        str = str.toLowerCase();

        for (int i = 0; i <= str.length() - 1; i++) {
            if (str.charAt(i) == 'a' || str.charAt(i) == 'e' || str.charAt(i) == 'i' || str.charAt(i) == 'o'
                    || str.charAt(i) == 'u') {
                continue;
            } else {
                count++;
            }
        }
        return count;
    }

}