RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.AnsiPos Function

Locates the position of a substring.

Pascal
function AnsiPos(const Substr: string; const S: string): Integer; overload;
C++
int AnsiPos(const AnsiString Substr, const AnsiString S);

Call AnsiPos to obtain the byte offset of the Substr parameter, as it appears in the string S. For example, if Substr is the string "AB", and S is the string "ABCDE", AnsiPos returns 1. If Substr does not appear in S, AnsiPos returns 0.

Note: This function supports multi-byte character sets (MBCS).
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!