Start a new project named Names. Build the form as shown below:
4. Write the code as shown below:
private void btnOK_Click(object sender, EventArgs e) { String s = txtInput.Text; // Split name on comma. String[] parts= s.Split(','); // parts[0] will be last name, parts[1] will be first name. // Set output to "Hello " + first name + " " + last name. lblOutput.Text = "Hello " + parts[1] + " " + parts[0]; }