How to ignorecase when using string.text.contains?

后端 未结 9 812
情深已故
情深已故 2021-01-07 18:11

I am trying to figure out how to check if a string contains another while ignoring case using .text.contains.

As it stands right now If I do this:

 D         


        
9条回答
  •  被撕碎了的回忆
    2021-01-07 19:00

    I solved this problem with .toUpper

    For example:

    Dim UGroup as String = dr.Item(2).ToString().ToUpper
    Dim s as String = ds.Item(1).ToString.ToUpper
    
    If s.Contains(UGroup) then MsgBox("Well done!")
    Else 
    End Sub
    

    Same procedure with .toLower

提交回复
热议问题