0

How can i programm a text(String) changer?

I mean like when a=c b=g String text = "abababa"; System.out.println(text); Output: cgcgcgc How can i programm it which satatement do i need? Sry for my bad english...

21st Nov 2017, 4:22 PM
Giovanni Palluotto
Giovanni Palluotto - avatar
1 Odpowiedź
+ 1
String text = "abababa"; String result = text.replace('a', 'c'); System.out.println(result); output: cbcbcbc
21st Nov 2017, 4:37 PM
John Wells
John Wells - avatar