C#编程的小问题
string text = textBox1.Text;string text1 = text.Substring(1);
string test2 = text1 + text[0];
textBox1.Text = test2;
中的text[0];是怎样来的?????
中的text[0];是怎样来的?????
答案:text 是一个 string 对象,text[i] 表示 第 i+1 个字符。。
比如 text 为 "123456" 的话,那么 text[0] 的值就是 '1'string text="abcde"
text[0]是一个字符'a'
text[2]就是字符'c'