[英]Windows form application c# spread text into different Textboxes
I have a string or TextBox
which contains three words. 我有一个包含三个单词的字符串或
TextBox
。
There is one space between words, and I want to move each word to three different TextBoxes
as shown in the picture 有词之间有一个空格,我想每一个字移动到三个不同的
TextBoxes
如图所示图片
string theString = "hardy majid Ali";
txt_first.Text = ?????;
txt_second.Text = ?????;
txt_3rd.Text = ?????;
How to achieve that? 如何实现呢? Thanks.
谢谢。
use split, like this code : 使用split,就像这样的代码:
var strs = theString.Split(' ');
txt_first.Text = strs[0];
txt_second.Text = strs[1];
txt_3rd.Text = strs[2];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.