FMX.Text.GetLexemeEnd

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetLexemeEnd(const Text: string; Index: Integer): Integer;

C++

extern DELPHI_PACKAGE int __fastcall GetLexemeEnd(const System::UnicodeString Text, int Index);

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'

See Also