import java.util.Scanner;
public class JavaProgram
{
public static void main(String args[])
{
String strOrig, strNew;
Scanner scan = new Scanner(System.in);
System.out.print("Enter a String : ");
strOrig = scan.nextLine();
System.out.print("Removing Vowels from The String [" +strOrig+ "]\n");
strNew = strOrig.replaceAll("[aeiouAEIOU]", "");
System.out.print("All Vowels Removed Successfully..!!\nNow the String is :\n");
System.out.print(strNew);
}
}
import java.util.Scanner;
public class JavaProgram
{
public static void main(String args[])
{
String str, r;
Scanner scan = new Scanner(System.in);
System.out.print("Enter a String : ");
str = scan.nextLine();
System.out.print("Removing Vowels from String [" +str+ "]\n");
r = removeVowels(str);
System.out.print("Vowels Removed from the Entered String Successfully..!!\nNow the String is :\n");
System.out.print(r);
}
private static String removeVowels(String s)
{
String finalString = "";
int i;
for(i=0; i
No comments:
Post a Comment