Skip to content

Instantly share code, notes, and snippets.

@ImDevinC
Last active August 29, 2015 13:56
Show Gist options
  • Save ImDevinC/9283524 to your computer and use it in GitHub Desktop.
Save ImDevinC/9283524 to your computer and use it in GitHub Desktop.
One string!
'Validate first name
Dim passenger As String
If strFirstName.Length <= 30 Then
passenger = strFirstName + " "
Else : MessageBox.Show("First name must be less than 30 characters")
End If
'Validate middle initial
If strMiddleName Like "[aA-zZ]" Then
passenger += strMiddleName + " "
Else : MessageBox.Show("Middle name must be a single initial")
End If
'Validate last name
If strLastName.Length <= 30 Then
passenger += strLastName
Else : MessageBox.Show("Last name must be less than 30 characters")
End If
PassengerDataList.Items.Add(passenger)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment