String str = "Test string";
StringBuilder strBuilder = new StringBuilder(str);
strBuilder.setCharAt(1, 'X');
str=strBuilder.toString();
String不可变
StringBuilder可变
参考:
http://stackoverflow.com/questions/4576513/str-setcharatindex-x
http://www.cnblogs.com/fancydeepin/archive/2013/04/23/min-snail-speak_string-stringbuffer-stringbuilder.html