Ad
  • Custom User Avatar

    I could be wrong but the issue might be the charAt = 1.
    Strings in Java start at index 0, so when the while loop goes through the characters of a string the first character of the string would be missed.

    For example: CAR
    C = Index 0
    A = Index 1
    R = Index 2

    Another issue could be if capitals are used. Those switch cases will only catch the lower case version of vowels. To fix this you can turn all the letters in str with str.toLowerCase() (.toUpperCase() to turn all letters in a string to upper case letters).