EchoAlertcom
IS-IT--Management
Hello,
I need to use InStr and Select Case together and I'm not sure what to do. I would like to process a string and do something depending on which word is found. Could someone suggest where I'm going wrong. Or suggest an all-around better way to do it please?
Thank you,
Steve
I need to use InStr and Select Case together and I'm not sure what to do. I would like to process a string and do something depending on which word is found. Could someone suggest where I'm going wrong. Or suggest an all-around better way to do it please?
Code:
strLine = "Georgia is on the East Coast"
Select Case strLine
Case If InStr(strLine, "Florida") > 0 Then
Response.Write "Florida"
Case If InStr(strLine, "Georgia") > 0 Then
Response.Write "Georgia"
Case If InStr(strLine, "Alabama") > 0 Then
Response.Write "Alabama"
Case Else
Response.Write "Other States"
End Case
Thank you,
Steve