FMX.Text.GetLexemeBegin
Delphi
function GetLexemeBegin(const AText: string; const AIndex: Integer): Integer;
C++
extern DELPHI_PACKAGE int __fastcall GetLexemeBegin(const System::UnicodeString AText, const int AIndex);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | FMX.Text.pas FMX.Text.hpp |
FMX.Text | FMX.Text |
Description
Returns the begin index of the word that contains a given index.
Text specifies the string in which to search.
Index specifies a position in Text used to identify the word. If the character at Index position is part of a word, then GetLexemeBegin returns the begin index of that word.
If the character at Index position is not within a word in Text, then GetLexemeBegin returns 0.
Example:
index:=GetWordBegin('This is my string', 7)
//result
index=5
//the word starts at position 5:'is'