txtShow.Text = txtShow.Text.Substring(0,txtShow.Text.Length - 1) + myJudgment + ".";帮解释下这句代码 主要是这个Substring(0,txtShow.Text.Length - 1)

来源:学生作业帮助网 编辑:作业帮 时间:2024/10/03 07:46:24
txtShow.Text = txtShow.Text.Substring(0,txtShow.Text.Length - 1) + myJudgment +
xRJASvn :V4 W" K "zV\EA:~3oOqGg܉yG.eĝP`XD@{hߏvQ(S<))f*]jt<İ{y ~VB.4i0Ik`GeB.p5ְ3%V@TM( CsCy2 }2XP$S ]{Y.(Q>gzx+/Y~ou(޴hk,Ts͕muS:jtdM̤Rx>

txtShow.Text = txtShow.Text.Substring(0,txtShow.Text.Length - 1) + myJudgment + ".";帮解释下这句代码 主要是这个Substring(0,txtShow.Text.Length - 1)
txtShow.Text = txtShow.Text.Substring(0,txtShow.Text.Length - 1) + myJudgment + ".";
帮解释下这句代码 主要是这个Substring(0,txtShow.Text.Length - 1)

txtShow.Text = txtShow.Text.Substring(0,txtShow.Text.Length - 1) + myJudgment + ".";帮解释下这句代码 主要是这个Substring(0,txtShow.Text.Length - 1)
Substring(startindex,length) 函数指从第startindex个字符开始截取长度为length的字符串,txtShow.Text.Substring(0,txtShow.Text.Length - 1)即从第0个字符开始截取长度为txtShow.Text.Length - 1的字符串,结果即为去掉txtShow.Text的最后一个字符;
语句txtShow.Text = txtShow.Text.Substring(0,txtShow.Text.Length - 1) + myJudgment + ".";即将得到的字符串与myJudgment及‘.’连接后重新赋给txtShow.Text