I need a method that switches a letter from a specific index with another letter. Is there anything like it?
Like so:
String word = "test";
String letter = "e";
String secretWord = "????";
find the index of letter e and then find if e is in word. Then switch a “?” based on the index of the e in test.
So it would be ?e?? for secretWord.
This Code is for JAVA…… Try it