Java String Starts Wtih startsWithVowel(String string)

Here you can find the source of startsWithVowel(String string)

Description

starts With Vowel

License

Open Source License

Declaration

public static boolean startsWithVowel(String string) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static char[] VOWELS = { 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U' };

    public static boolean startsWithVowel(String string) {
        char[] stringChars = string.toCharArray();
        vowelLoop: for (char c : VOWELS) {
            for (char c2 : stringChars) {
                if (Character.isLetter(c2)) {
                    if (c2 == c) {
                        return true;
                    } else {
                        continue vowelLoop;
                    }//from  w  w w  . j  av a  2  s.c  om
                }
            }
        }
        return false;
    }
}

Related

  1. startsWithSpaces(final String text)
  2. startsWithTag(String html, int position)
  3. startsWithUppercase(String str)
  4. startsWithUpperCase(String text)
  5. startsWithURIScheme(String arg)
  6. startsWithVowel(String text)
  7. startsWithVowel(String value)
  8. startsWithVowel(String word)
  9. startsWithWeight(String s1, String s2)