IFreeTextComparer.MatchCase

Syntax

MatchCase: Boolean;

Description

The MatchCase property determines whether to take into account the case while comparing.

Comments

Available values:

Example

To execute the example, add a link to the Collections system assembly.

Sub UserProc;
    Function TestCompare(x: String; y: String): Integer;
    Var
        pComparer: IComparer;
        FreeComparer: IFreeTextComparer;
        iResult: Integer;
    Begin
        pComparer := Comparer.FreeTextComparer;
        FreeComparer := pComparer As IFreeTextComparer;
        FreeComparer.MatchCase := True;
        FreeComparer.WholeWord := True;
        iResult := pComparer.Compare(x, y);
        Select Case iResult
            Case 0: Debug.WriteLine("'" + x + "'  '" + y + "' -> objects match");
            Case - 1: Debug.WriteLine("'" + x + "'  '" + y + "' - partial match or occurrence is found");
        End Select;
        Return iResult;
    End Function TestCompare;
Begin
    TestCompare("Permskyy""permskyy");
    TestCompare("Permskyy""perm");
    TestCompare("Permskyy""permskyy");
    TestCompare("Permskyy""Perm");
End Sub UserProc;

After executing the example the console window displays comparison results taking into account the case and the completeness of the words.

See also:

IFreeTextComparer