I have a string in which i want to replace a specific sequence of three final characters ("123") with a static character ("5"). For example, the string "hello123" needs to be "hello5", or "goodbye123" needs to be "goodbye5".
I know charAt can index one character, then a subString method can replace that character with something else, but how can three characters be repaced with one?
Bookmarks