Good evening all,
I've been staring at the below problem and am more confused than before hand. I've done strings before and replaced letters within them but never in a for loop. I've only used the replace method which is something that we cannot use. Any guidance would be greatly appreciated.
Let
word be a
String variable referencing a non-empty string. Write a for loop that prints the string with all occurrences of the lowercase letter 'n' replaced with 'r'. For example, if word references the string "Kenny", then your code should print "Kerry". Do not use the replace() method of the String class.
When I've done for loops in the past it was for integers and when I try and code for chars & strings I get lost.