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

来源:互联网 发布:python unpack修饰符 编辑:程序博客网 时间:2024/05/21 08:45
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"); 
 } 
0 0
原创粉丝点击