Vcl.ComCtrls.TCustomRichEdit.FindText

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function FindText(const SearchStr: string;  StartPos, Length: Integer; Options: TSearchTypes): Integer;

C++

int __fastcall FindText(const System::UnicodeString SearchStr, int StartPos, int Length, TSearchTypes Options);

Properties

Type Visibility Source Unit Parent
function public
Vcl.ComCtrls.pas
Vcl.ComCtrls.hpp
Vcl.ComCtrls TCustomRichEdit

Description

Searches a given range in the text for a target string.

Use FindText to search a range of text in a rich edit control for the string specified by the SearchStr parameter. Only the text in the range starting at the position StartPos and continuing through the next Length positions will be searched. Use Options to specify whether the search should match whole words only and whether the search should be case sensitive. FindText returns the position of the search string, where 0 is the position of the first character in the rich edit control (as opposed to the first position in the search range). If the search string does not appear in the indicated range, FindText returns -1.

Use FindText rather than programmatically searching through the text of the control, to keep from being thrown off by the encoding of rich text characteristics.

See Also

Code Examples