Write a program in java to accept a string in upper case and replace all the vow
with Asterisk (*) present in the String.
Sample Input : "TATA STEEL IS IN JAMSHEDPUR"
Sample output : T*T* ST**L*S 'N J*MSHEDP*R
Answers
Answered by
3
Explanation:
public class VowelswithStar
{
public static void main(String[] args)
{
String string = "TATA STEEL IS IN JAMSHEDPUR"; //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
}
}
Similar questions
CBSE BOARD XII,
5 months ago
English,
5 months ago
Math,
11 months ago
Science,
1 year ago
Math,
1 year ago