C#字符串与char数组互转!

字符串转换成Char数组
string str="abcdefghijklmnopqretuvwxyz";
char[] chars=str.ToCharArray();

char数组转换成字符串
char[] chars=new char[]{'a','b','c','d'};
string str=new string(chars);

你可能感兴趣的:(C#字符串与char数组互转!)