MatchCase: Boolean;
The MatchCase property determines whether to take into account the case while comparing.
Available values:
True. The case is taken into account. For example, words Report and REPORT are considered as not matching.
False. Default value. Case is not taken into account. For example, words Report and REPORT are considered as matching.
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: