Java List question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Java List question

I have a list. How can I check thru it and replace all index with a value of "G" with "B" if my list was mylist={"A", "G", "C"}; but I wanted to change it to mylist={"A", "B", "C"};

17th Mar 2017, 10:52 PM
LordHill
LordHill - avatar
2 Answers
+ 3
Collections.replaceAll(mylist, "G", "B");
18th Mar 2017, 1:27 AM
ChaoticDawg
ChaoticDawg - avatar
0
thanks! Google wasn't getting me anywhere and it was driving me nuts
18th Mar 2017, 2:51 AM
LordHill
LordHill - avatar