Here you can find the source of colorString(String string)
public static String colorString(String string)
//package com.java2s; //License from project: Open Source License public class Main { public static String colorString(String string) { return colorString(string, '&'); }/*from www . j a va 2 s .c o m*/ public static String colorString(String string, char c) { if (string == null) { throw new IllegalArgumentException("String cannot be null"); } return string.replace(c, '\u00A7').replace("\u00A7\u00A7", String.valueOf(c)); } }