c#截取字符,显示在textbox控件上
答案:4 悬赏:50
解决时间 2021-02-17 06:36
- 提问者网友:贪了杯
- 2021-02-16 14:17
c#截取字符,显示在textbox控件上
最佳答案
- 二级知识专家网友:神的生死簿
- 2021-02-16 15:56
private void button1_Click(object sender, EventArgs e)
{
string str = this.textBox1.Text;
this.textBox2.Text = str.Substring(0, 1);
this.textBox3.Text = str.Substring(1, 1);
this.textBox4.Text = str.Substring(2, 1);
this.textBox5.Text = str.Substring(3, 1);
}
{
string str = this.textBox1.Text;
this.textBox2.Text = str.Substring(0, 1);
this.textBox3.Text = str.Substring(1, 1);
this.textBox4.Text = str.Substring(2, 1);
this.textBox5.Text = str.Substring(3, 1);
}
全部回答
- 1楼网友:长青诗
- 2021-02-16 19:06
哦
- 2楼网友:执傲
- 2021-02-16 18:59
使用substr
- 3楼网友:傲气稳了全场
- 2021-02-16 17:20
string objStr="";//需要分开显示的字符串,在使用的过程中可以使用您自己规定的TextBox控件中得值。
剩下的我想可以这么写.思路是这样的:
先判断objStr是否满足长度要求(与需要几个TextBox控件有关)。
然后使用ToCharArray()[i],方法来进行。
剩下的我想可以这么写.思路是这样的:
先判断objStr是否满足长度要求(与需要几个TextBox控件有关)。
然后使用ToCharArray()[i],方法来进行。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯