RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
StrUtils.AnsiResemblesText Function

Indicates whether two strings are similar.

Pascal
function AnsiResemblesText(const AText: string; const AOther: string): Boolean; overload;
C++
Boolean AnsiResemblesText(const AnsiString AText, const AnsiString AOther);

AnsiResemblesText returns true if the string specified by AText is "similar" to the string specified by AOther, or false if the two strings are not sufficiently similar. 

The algorithm that controls whether AnsiResemblesText considers two strings similar is specified by the AnsiResemblesProc variable. By default, AnsiResemblesProc is set to SoundexProc, which converts both strings to a phonetic representation using a Soundex algorithm and compares up to 4 characters of the resulting phonetic representation. By changing the function assigned to AnsiResemblesProc, you can change the comparison made by AnsiResemblesText. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!