一、字符数组转字符串
char[] cs= {'h','e','l','l','o'};
String s=new String(cs);
二、字符串转字符数组
String s="world";
char[] cs = s.toCharArray();
一、字符数组转字符串
char[] cs= {'h','e','l','l','o'};
String s=new String(cs);
二、字符串转字符数组
String s="world";
char[] cs = s.toCharArray();
转载于:https://www.cnblogs.com/wei-jing/p/10778093.html