Header function RightStr(const AText: string; const ACount: Integer): string; $[StrUtils.pas
Function returns the ACount characters on the right side of the string AText
Description RightStr('123456', 3) = '456'
Refer to function System.Copy
Example Edit3.Text := RightStr(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Header function MidStr(const AText: string; const AStart, ACount: Integer): string; $[StrUtils.pas
Function returns the string AText ACount characters starting from AStart
It means Copy
Refer to function System.Copy
Example Edit3.Text := MidStr(Edit1.Text, SpinEdit1.Value, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
Header function SearchBuf(Buf: PChar; BufLen: Integer; SelStart, SelLength: Integer; SearchString: String; Options: TStringSearchOptions = [soDown]): PChar; $[StrUtils.pas
Function returns the first searched pointer position
Explain this function is often used to search strings in text
Reference <NULL>
example
//////////Begin SearchBuf
function SearchEdit(EditControl: TCustomEdit; const SearchString: String;
SearchOptions: TStringSearchOptions; FindFirst: Boolean = False): Boolean;
var
Buffer, P: PChar;
Size: Word;
Begin
Result := False;
if (Length(SearchString) = 0) then Exit;
Size := EditControl.GetTextLen;
if (Size = 0) then Exit;
Buffer := StrAlloc(Size + 1);
try
EditControl.GetTextBuf(Buffer, Size + 1);
P := SearchBuf(Buffer, Size, EditControl.SelStart, EditControl.SelLength,
SearchString, SearchOptions);
if P <> nil then begin
EditControl.SelStart := P - Buffer;
EditControl.SelLength := Length(SearchString);
Result := True;
end;
Finally
StrDispose(Buffer);
end;
end;
PRocedure TForm1.Button1Click(Sender: TObject);
var
SearchOptions: TStringSearchOptions;
Begin
SearchOptions := [];
if CheckBox1.Checked then
Include(SearchOptions, soDown);
if CheckBox2.Checked then
Include(SearchOptions, soMatchCase);
if CheckBox3.Checked then
Include(SearchOptions, soWholeWord);
SearchEdit(Memo1, Edit1.Text, SearchOptions);
Memo1.SetFocus;
end;
//////////End SearchBuf
━━━━━━━━━━━━━━━━━━━━━
Header function Soundex(const AText: string; ALength: TSoundexLength = 4): string; $[StrUtils.pas
Function returns the detection string
Explanation: According to the detection method (Soundex), you can find the intersecting string; http://www.nara.gov/genealogy/coding.Html
Reference <NULL>
Example Edit2.Text := Soundex(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Header function SoundexInt(const AText: string; ALength: TSoundexIntLength = 4): Integer; $[StrUtils.pas
Function returns the detecting integer
It means that the greater the value of ALength, the higher the decoding accuracy
Reference <NULL>
Example SpinEdit2.Value := SoundexInt(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Header function DecodeSoundexInt(AValue: Integer): string; $[StrUtils.pas
Function returns the decoding of the probe integer
Description DecodeSoundexInt(SoundexInt('hello')) is equivalent to Soundex('hello')
Reference <NULL>
Example Edit2.Text := DecodeSoundexInt(SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
First function SoundexWord(const AText: string): Word; $[StrUtils.pas
Function returns the detecting text value
Indicates that there is no parameter ALength that has been fixed to 4
Reference <NULL>
Example SpinEdit2.Value := SoundexWord(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
First function DecodeSoundexWord(AValue: Word): string; $[StrUtils.pas
Function returns the decoding of the detecting text value
Description DecodeSoundexWord(SoundexWord('hello')) is equivalent to Soundex('hello')
Reference <NULL>
Example Edit2.Text := DecodeSoundexWord(SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
Header function SoundexSimilar(const AText, AOther: string; ALength: TSoundexLength = 4): Boolean; $[StrUtils.pas
Function returns whether the probe strings of the two strings are the same
Description Result := Soundex(AText, ALength) = Soundex(AOther, ALength)
Reference <NULL>
Example CheckBox1.Checked := SoundexSimilar(Edit1.Text, Edit2.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Header function SoundexCompare(const AText, AOther: string; ALength: TSoundexLength = 4): Integer; $[StrUtils.pas
Function returns the result of comparing two strings to detect strings
Description Result := AnsiCompareStr(Soundex(AText, ALength), Soundex(AOther, ALength))
Reference function SysUtils.AnsiCompareStr
Example SpinEdit2.Value := SoundexCompare(Edit1.Text, Edit2.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
First function SoundeXProc(const AText, AOther: string): Boolean; $[StrUtils.pas
Function call SoundexSimilar to return the probe strings of the two strings.
Description of the default value of system variable AnsiResemblesProc
Reference function StrUtils.AnsiResemblesText
Example [var AnsiResemblesProc: TCompareTextProc = SoundexProc;]