Say I have a very long string like 'ABCEEEEEEDEDAAA......' but it is only made up of five letters. Say I want all 'A' to be 'D' and vice versa, and same to 'B' and 'C'(an example would be nucleotides in DNA....). The example, after modification, would be 'DCBEEEEEEAEADDD....... I realized that code like string.replace('A','D').replace('D','A') just wouldn't work. And I would like to know what is the fastest approach since the other approach that comes up to me is just finding every index, which looks a little bit complicated.