19 lines
472 B
Java
19 lines
472 B
Java
package openonyx.events;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
public final class ChatFormattingUtils {
|
|
private static final Pattern PATTERN = Pattern.compile("(?i)§[0-9A-FK-OR]");
|
|
|
|
public static String L(String string) {
|
|
if (string != null && string.indexOf(167) >= 0) {
|
|
return PATTERN.matcher(string).replaceAll("").replace("§", "");
|
|
} else {
|
|
return string == null ? "" : string;
|
|
}
|
|
}
|
|
|
|
private ChatFormattingUtils() {
|
|
}
|
|
}
|