diff --git a/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java b/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java index 6f25002..fe7766e 100644 --- a/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java +++ b/src/main/java/net/t2code/lib/Spigot/Lib/replace/Replace.java @@ -63,6 +63,19 @@ public class Replace { return rp; } + public static String removeColorCode(String value){ + String text = value.replace("&", "§"); + while(text.contains("§")){ + int stelle = text.indexOf("§"); + if(text.length() >= stelle+2) { + text = text.substring(0, stelle) + text.substring(stelle + 2); + }else{ + text = text.substring(0, stelle) + text.substring(stelle + 1); + } + } + return (text); + } + public static List replacePrice(String prefix,Player player, List Text, String price) { List rp = new ArrayList();