Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void ex_4(String str){
- String nova = " ";
- for(int i=0; i<str.length(); i++){
- if (i == str.length()-1){
- nova = nova.concat("" + str.charAt(i));
- break;
- }
- if(isVowel(str.charAt(i)) && isVowel(str.charAt(i+1))){
- nova = nova.concat(""+str.charAt(i)+"p");}
- else{
- nova = nova.concat(""+str.charAt(i));
- }
- }
- System.out.printf("%s", nova);
- }
- public static boolean isVowel(char i){
- String vogais = "aeiou";
- for(int k = 0; k<vogais.length(); k++){
- if(vogais.charAt(k) == i) return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement