FMX.Text.GetLexemeEnd
Delphi
function GetLexemeEnd(const AText: string; const AIndex: Integer): Integer;
C++
extern DELPHI_PACKAGE int __fastcall GetLexemeEnd(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 end 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 GetLexemeEnd returns the end index of that word.
If the character at Index position is not within a word in Text, then GetLexemeEnd returns Index.
Example:
index:=GetWordEnd('This is my string', 8)
//result
index=9
//the word ends at position 9:'my'