s.Substring(0,s.Length - 1)这里的s.Length - 1有什么作用string s = comboBox2.Text + '/' + listView3.SelectedItems[0].Text;string m = s.Substring(0,s.Length - 1);comboBox2.Text = m;listView3.Items.Clear();fangfa(@"ftp://hhhh@219.220.112.130"+m)

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 07:11:27
s.Substring(0,s.Length - 1)这里的s.Length - 1有什么作用string s = comboBox2.Text + '/' + listView3.SelectedItems[0].Text;string m = s.Substring(0,s.Length - 1);comboBox2.Text = m;listView3.Items.Clear();fangfa(@
xMKAǿEE}T)ftZ .F42hB/^Kh) 6yoZX͸nRpQ$ o|:,Yc9d@`-ƳsټyhLtc9l`TI+k`(¯:鍠RH@dJ,IX&y#S C "0 E B!OUq^1#\n,qE9-,CNNR*C@NFѦ"cRlthm+o(T#O'"eE tpLvhsˎe5= rǎԠh9y0guJ2kLxޯ50

s.Substring(0,s.Length - 1)这里的s.Length - 1有什么作用string s = comboBox2.Text + '/' + listView3.SelectedItems[0].Text;string m = s.Substring(0,s.Length - 1);comboBox2.Text = m;listView3.Items.Clear();fangfa(@"ftp://hhhh@219.220.112.130"+m)
s.Substring(0,s.Length - 1)这里的s.Length - 1有什么作用
string s = comboBox2.Text + '/' + listView3.SelectedItems[0].Text;
string m = s.Substring(0,s.Length - 1);
comboBox2.Text = m;
listView3.Items.Clear();
fangfa(@"ftp://hhhh@219.220.112.130"+m);

s.Substring(0,s.Length - 1)这里的s.Length - 1有什么作用string s = comboBox2.Text + '/' + listView3.SelectedItems[0].Text;string m = s.Substring(0,s.Length - 1);comboBox2.Text = m;listView3.Items.Clear();fangfa(@"ftp://hhhh@219.220.112.130"+m)
s.Length 是s字符串变量的长度,-1的意思的截取到倒数二数,整个意思就是截取s字符串“得到”最后一个字符 .
至于前面的那个0就是从第一个开始截取,一般索引是从0开始的.