字符串替换为unicode
public class Main { private String jaText = "this is a test "; /* N o w J a v a . c o m */ public Main() { String replaced = jaText.replaceFirst("\u6587\u5B57", "mojibake"); System.out.printf("Replaced: %s\n", replaced); } }
public class Main { private String jaText = "this is a test "; /* N o w J a v a . c o m */ public Main() { String replaced = jaText.replaceFirst("\u6587\u5B57", "mojibake"); System.out.printf("Replaced: %s\n", replaced); } }