import java.io.*;
public class replace
{
public static void main(String []args)
{
String str,str1;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter first String ");
str=cin.readLine();
str1=str.replace('a','#');
System.out.println("New string is :- "+str1);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
public class replace
{
public static void main(String []args)
{
String str,str1;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter first String ");
str=cin.readLine();
str1=str.replace('a','#');
System.out.println("New string is :- "+str1);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
No comments:
Post a Comment