I have a String , String originalString= "This car is my car";
I want to replace "car" with "bike", without using string replace()
method.
class StringTest{
public static void main(String[] args){
String originalString = "This car is my car";
String replacedString = replaceMethod(original, "car", "bike");
System.out.println(replacedString);
}
}
static String replaceMethod( String original, String toReplace, String replacedWith){
// enter code here
return "";
}