How to ignorecase when using string.text.contains?

后端 未结 9 809
情深已故
情深已故 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:04

    Or you can use RegularExpressions like this.

    First, import the RegularExpressions:

    Imports System.Text.RegularExpressions
    

    then try this code:

    Dim match As Match = Regex.Match(Textbox1.text,"My house is cold",RegexOptions.IgnoreCase)
    If match.Success Then
       Msgbox(match.Value)
    End If
    

提交回复
热议问题