
a java program to replace all matching substrings

class ReplaceString
{
public static void main(String[] args)
{
String st="Where there is will, there is a way";
String sub="the";
System.out.println(st.replace("is",sub));
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.