Select Case..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eowyne
    New Member
    • Feb 2008
    • 1

    Select Case..

    Hi there!
    I'm busy making an application (in Vb2005) which checks a chat line to see if there's a command in it..

    so, When i am doing this, I want to make use of the Select Case statement..

    This is my code so far:

    Code:
    Dim message as string = StrConv(Message, 2) 'Make it Lowercase
    Dim Reply as String
    Select Case Message
    Case message.Contains("hi")
    Reply = " Hello!"
    end select
    But, here's the problem.. no matter how or what I try, whenever the message is "hi", the case ALWAYS returns false..

    Can anyone support me in this action?

    grt, Eowyne
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    If you have "hi" on its own this will work, but if you need contains better to use if else statement. HTH.

    Comment

    Working...