Let's assume that I have an ArrayList function that is being printed via wordscan. (like such) (yes, this is how it's formatted, sorry in advance. ill make corrections to formatting for those who need it but im not asking for a rewrite, rather a fix)
I want to take the "forEach" variable and prior to the command running have the code go "alright, does the element that contains the (player) variable? If so, it needs to be highlighted)." Any help is appreciated, and corrections can and will be made accordingly.
System.out.print("33[H33[2J");
System.out.flush();
System.out.println(TEXT_GREEN + "WINNER LIST" + TEXT_RESET);
playerScore2.forEach(System.out::println);
System.out.println(TEXT_RED + "LOSER LIST" + TEXT_RESET);
playerScore3.forEach(System.out::println);
System.out.println("");
System.out.println("Do you think you're up to the challenge? (y/n)");```
question from:
https://stackoverflow.com/questions/65905981/how-would-one-go-about-printing-an-arraylist-in-java-repl-it-and-having-my-cod 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…