Hi so I'm having trouble manipulating strings in java. My problem is to search through a string and when a vowel is found I want to insert another string at the position. Here is what I have:
Scanner scan = new Scanner(input.getText());
    while(scan.hasNext()){
        String str = scan.next();
        str = str.toUpperCase();
        String str1 = "";
        for (int i = 0; i < str.length(); i++){
            if (str.charAt(i) == 'A' || str.charAt(i) == 'E'
                    || str.charAt(i) =='I' || str.charAt(i) == 'O'
                    || str.charAt(i) == 'U'){
                    str1 = str.substring(0 , i) + "AHHH" + str.substring(i);
            }
        }
        System.out.print(str1);
    }
So if the string thats being read in by scanner is hello it should return:
HAHHHELLAHHHO
My program is returning:
HAHHHELLOHELLAHHHO
So my program is finding the first vowel adding AHHH and then concatenating it with the rest of the string. Then it finds the next vowel and does the same thing.
Anyone know how I could better manipulate this string or is this possible with just using a string?

