How do you replace all strings in a string in Java?

String str = “[Chrissman-@1]”; str = replaceAll(“\\[\\]”, “”); String[] temp = str. split(“-@”); System. out. println(“Nickname: ” + temp[0] + ” | Power: ” + temp[1]);

Sizin İçin Seçtik  What is the basic difference between replace and replace all?

Leave a Reply

Your email address will not be published. Required fields are marked *