Java字符/字符串互转

字符串转字符数组:char[ ] chars=s.toCharArray();
字符数组转字符串:string s1=new String(chars);
StringBuilder类转String类:string s1=s.toString();
String类转StringBuilder类:StringBuilder s2=new StringBuilder(s);

你可能感兴趣的:(java,开发语言)