字符串转字符数组:char[ ] chars=s.toCharArray();
字符数组转字符串:string s1=new String(chars);
StringBuilder类转String类:string s1=s.toString();
String类转StringBuilder类:StringBuilder s2=new StringBuilder(s);
Java字符/字符串互转
最新推荐文章于 2024-06-05 08:15:43 发布
字符串转字符数组:char[ ] chars=s.toCharArray();
字符数组转字符串:string s1=new String(chars);
StringBuilder类转String类:string s1=s.toString();
String类转StringBuilder类:StringBuilder s2=new StringBuilder(s);