Let's say I have a string
string myWord="AAAAA";
I want to replace "AA" with "BB", but only the last occurrence, like so:
"AAABB"
Neither string.replace() nor string.replaceFirst() would do the job. Is there a string.replaceLast()? And, If not, will there ever be one or is there an alternative also working with regexes?