I'm new to Java and OOP. I'm currently studying for a class test and have the following question:
My task is to replace some characters in a given sentence by only using the length()
and charAt()
methods.
I was given the sentence:
"This is the letter i!"
this method:
public static String replaceCharacter(String w, char b, String v) {
}
and the result should look like this:
"Theasts easts the letter east"
This is my starting point. I have no idea how to solve this one without using substring()
method. Hope somebody can help me and give some explanation.