private void button1_Click(object sender, EventArgs e) { var input=textBox1.Text; var matches = Regex.Matches(input, @"\w+[^\s]*\w+|\w"); foreach (Match match in matches) { var word = match.Value; textBox2.Text = word; } foreach (Match match in matches) { var word = match.Value; textBox3.Text = word; } }
var input = textBox1.Text; var matches = Regex.Matches(input, @"\w+[^\s]*\w+|\w"); if (matches.Count == 2) { textBox2.Text = matches[0].Value; textBox3.Text = matches[1].Value; }
private void button1_Click(object sender, EventArgs e) { string s = textBox1.Text; string[] words = s.Split(' '); textBox2.Text = words[0]; textBox3.Text = words[1]; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)