Java program to replace vowels with star


Program

//Program to replace vowels with star
public class VowelswithStar
{

public static void main(String[] args)
{
String string = "Welcome to Candid Java Programming"; //Input String
System.out.println("Input String : "+string); //Displaying Input String
string = string.replaceAll("[AaEeIiOoUu]", "*"); //Replace vowels with star
System.out.println(string); //Display the word after replacement

}

}

Output

Input String : Welcome to Candid Java Programming

W*lc*m* t* C*nd*d J*v* Pr*gr*mm*ng




Related Post

Comments


©candidjava.com