char[]与string之间的转换:
string转char[]:
string a="afsdafa";
char[] data=a.ToCharArray();
char[]转string:
string str=new string(data);
byte[]与string之间的转换:
byte[] bydata=Encoding.UTF8.GetBytes(a);
string str=Encoding.UTF8.GetString(bydata);
char[]与string之间的转换:
string转char[]:
string a="afsdafa";
char[] data=a.ToCharArray();
char[]转string:
string str=new string(data);
byte[]与string之间的转换:
byte[] bydata=Encoding.UTF8.GetBytes(a);
string str=Encoding.UTF8.GetString(bydata);