CaseSensitive Property

Returns or sets whether matching is case-sensitive.

Syntax

[form!]VSFlexString.CaseSensitive[ = {True | False} ]

Remarks

Setting CaseSensitive to True will in some cases allow you to use simpler, regular expressions. Setting it to False gives more control over the matching process.

For example:

    Dim fs As New VSFlexString

    fs.Text = "This text contains the 'this' word."

    fs.Pattern = "This"

   

    fs.CaseSensitive = True

    Debug.Print "Case Sensitive: "; fs.MatchCount; " Match(es)"

    For i = 0 To fs.MatchCount - 1

        Debug.Print " "; fs.MatchString(i)

    Next

   

    fs.CaseSensitive = False

    Debug.Print "Case Insensitive: "; fs.MatchCount; " Match(es)"

    For i = 0 To fs.MatchCount - 1

        Debug.Print " "; fs.MatchString(i)

    Next

This code would produce the following output:

Case Sensitive:  1  Match(es)

 This

Case Insensitive:  2  Match(es)

 This

 this

Data Type

Boolean

Default Value

True

See Also

VSFlexString Control