Answers to Comparing Strings Using LCase() Function Exercise
The ToUpper( ) or ToLower( ) methods do the same thing.
What would the result be if the user entered the following strings in the txtState textbox?
txtState.Text strState Output
1) Shipping Charge = $30
2) Shipping Charge = $32.50
3)
Incorrect State
4) Shipping Charge = $32.50 Note: contents of strState is always in all lowercase. Comparison
is to all lowercase string constants.
Dim strState As String
strState = txtState.Text.ToLower
If strState =
"
msgBox("Shipping Charge = $25")
ElseIf strState = "
msgBox("Shipping Charge = $30")
ElseIf strState = "
msgBox("Shipping Charge = $32.50")
Else
msgBox("Incorrect
State"
End If