string 转换成 Char[]
string ss = "abcdefg"; char[] cc = ss.ToCharArray();
Char[] 转换成string
string s = new string(cc);
byte[] 与 string 之间的转换
byte[] bb = Encoding.UTF8.GetBytes(ss); string s = Encoding.UTF8.GetString(bb);
string[] 转换成string
string strOr = "OR"; string result = string.Concat(new string[]{" A ",strOr," B ",Environment.NewLine," C ",strOr," D "});
参考文章:
http://www.cnblogs.com/wintalen/archive/2010/12/20/1911599.html
C# char[]与string之间的相互转换
时间: 2024-10-23 17:29:22