Indy 9 | Content | Index | Reference

AnsiPosIdx
See Also, Unit: IdGlobal
Locates the position of a string within another string.

    function AnsiPosIdx(const ASubStr: AnsiString; const AStr: AnsiString; AStartPos: Cardinal = 0): Cardinal;

Unit
IdGlobal
Parameters
const ASubStr: AnsiString
ANSI string values to be located.
const AStr: AnsiString
ANSI string values to be searched.
AStartPos: Cardinal = 0
Default value is 0.
Return Value
Cardinal - Position where substring is located, or 0 when not found.
Description
AnsiPosIdx is a Cardinal function that returns the position of a string in another string using a given starting position. ASubStr is the ANSI string to be located in AStr starting with character found in position AStartPos. AnsiPosIdx adjusts the position where ASubStr is located top account for Leading- and Trailing- byte type in multi-byte character sets.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.