Skip to content

Instantly share code, notes, and snippets.

@tjbenator
Created August 3, 2014 16:44
Show Gist options
  • Save tjbenator/dd8b4c51faa6f25610e9 to your computer and use it in GitHub Desktop.
Save tjbenator/dd8b4c51faa6f25610e9 to your computer and use it in GitHub Desktop.
public class ColorConvert {
public static String Convert(String sentence) {
sentence = sentence.replaceAll("&0", "§0");
sentence = sentence.replaceAll("&1", "§1");
sentence = sentence.replaceAll("&2", "§2");
sentence = sentence.replaceAll("&3", "§3");
sentence = sentence.replaceAll("&4", "§4");
sentence = sentence.replaceAll("&5", "§5");
sentence = sentence.replaceAll("&6", "§6");
sentence = sentence.replaceAll("&7", "§7");
sentence = sentence.replaceAll("&8", "§8");
sentence = sentence.replaceAll("&9", "§9");
sentence = sentence.replaceAll("&a", "§a");
sentence = sentence.replaceAll("&b", "§b");
sentence = sentence.replaceAll("&c", "§c");
sentence = sentence.replaceAll("&d", "§d");
sentence = sentence.replaceAll("&e", "§e");
sentence = sentence.replaceAll("&f", "§f");
return sentence;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment