Here you can find the source of startsWithVowel(String value)
Parameter | Description |
---|---|
value | String to check |
public static boolean startsWithVowel(String value)
//package com.java2s; public class Main { /**/*from w ww .j a v a 2 s. c om*/ * Check to see if the string starts with a vowel. * * @param value String to check * @return true if value starts with a, e, i, o, or u (but not sometimes y). * Check is case insensitive. */ public static boolean startsWithVowel(String value) { if ((value == null) || value.equals("")) { return false; } char lower = Character.toLowerCase(value.charAt(0)); return (lower == 'a') || (lower == 'e') || (lower == 'i') || (lower == 'o') || (lower == 'u'); } }