Public Class frmName

  Private Sub btnAnalyze_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnalyze.Click
    'Determine a person's first name and the length of the second name
    Dim fullName, firstName, lastName As String
    Dim m As Integer
    Dim n As Integer    'location of the space separating the two names
    fullName = txtName.Text
    n = fullName.IndexOf(" ")
    firstName = fullName.Substring(0, n)
    lastName = fullName.Substring(n + 1)
    'Display the desired information in a list box
    m = lastName.Length
    lstResults.Items.Clear()
    lstResults.Items.Add("First name: " & firstName)
    lstResults.Items.Add("Your last name has " & m & " letters.")
  End Sub

End Class
