您的位置:首页 > 其它

字符串和字符数组之间的转换

2016-12-09 19:12 309 查看
privatevoid TestStringChars()



   string str =
"mytest"; 

   char[] chars = str.ToCharArray(); 

   this.textBox1.Text =
""; 

   this.textBox1.AppendText("Length of \"mytest\" is " + str.Length
+ "\n"); 

   this.textBox1.AppendText("Length of char array is " + chars.Length +
"\n"); 

   this.textBox1.AppendText("char[2] = " + chars[2] +
"\n"); 

 } 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: