I have a string made up of several commas, and also several color formatting codes in the form of the '§' symbol and then a character (ex. "§a§6Text, here" should become "Text here). I want to remove all of the commas, but also all of the color formatting. I used this code, but when it runs, it doesn't end up removing the formatting, it becomes some sort of mystery character that changes depending on which text editor I open it in ("�" in notepad/++, "�f�f�" in Excel).
I'm running Java 11, and I checked my RegEx in notepad++, it seems to work. As of now, my code successfully removes commas, but not the color formatting.
for (String entry : lineEntries) {
String entryx = entry.replace(",", "");
entryx = entryx.replace("§.", "");
refinedEntries.add(entryx);
}
If I were to input "§f§f§6Spicy,Special", I would want it to return "SpicySpecial"
Edit: fixed a separate error that still was a pretty big deal, but did not fix the problem.