1def anti_vowel(c):
2 newstr = c
3 vowels = ('a', 'e', 'i', 'o', 'u')
4 for x in c.lower():
5 if x in vowels:
6 newstr = newstr.replace(x,"")
7
8 return newstr
9
1string = input("Enter any string: ")
2if string == 'x':
3 exit();
4else:
5 newstr = string;
6 print("\nRemoving vowels from the given string");
7 vowels = ('a', 'e', 'i', 'o', 'u');
8 for x in string.lower():
9 if x in vowels:
10 newstr = newstr.replace(x,"");
11 print("New string after successfully removed all the vowels:");
12 print(newstr);
1import java.util.Scanner;
2public class RemoveVowelsUsingMethod
3{
4 static String removeVowel(String strVowel)
5 {
6 Character[] chVowels = {'a', 'e', 'i', 'o', 'u','A','E','I','O','U'};
7 List<Character> li = Arrays.asList(chVowels);
8 StringBuffer sb = new StringBuffer(strVowel);
9 for(int a = 0; a < sb.length(); a++)
10 {
11 if(li.contains(sb.charAt(a)))
12 {
13 sb.replace(a, a + 1, "");
14 a--;
15 }
16 }
17 return sb.toString();
18 }
19 public static void main(String[] args)
20 {
21 String strInput = "Flower Brackets";
22 System.out.println(removeVowel(strInput));
23 }
24}
25
26
27
1# removing vowels in a string
2def anti_vowel(c):
3 newstr = c
4 vowels = ('a', 'e', 'i', 'o', 'u')
5 for x in c.lower():
6 if x in vowels:
7 newstr = newstr.replace(x,"")
8
9 return newstr