forked from 790hanu/Annex-qr-code-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoveVowels.java
More file actions
24 lines (21 loc) · 753 Bytes
/
RemoveVowels.java
File metadata and controls
24 lines (21 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package day2;
import java.util.Scanner;
public class RemoveVowels {
public static void main(String[] args)
{
System.out.println("enter a string: ");
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == 'a' || s.charAt(i) == 'e'
|| s.charAt(i) == 'i' || s.charAt(i) == 'o'
|| s.charAt(i) == 'u' || s.charAt(i) == 'A'
|| s.charAt(i) == 'E' || s.charAt(i) == 'I'
|| s.charAt(i) == 'O'
|| s.charAt(i) == 'U') {
continue;
}
System.out.print(s.charAt(i));
}
}
}