RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.AnsiStrPos Function

Returns a pointer to the first occurrence of a substring.

Pascal
function AnsiStrPos(Str: PAnsiChar; SubStr: PAnsiChar): PAnsiChar; overload;
function AnsiStrPos(Str: PWideChar; SubStr: PWideChar): PWideChar; overload;
C++
PAnsiChar AnsiStrPos(PAnsiChar Str, PAnsiChar SubStr);
PWideChar AnsiStrPos(PWideChar Str, PWideChar SubStr);

Call AnsiStrPos to locate the first occurrence of SubStr in Str. If SubStr does not occur in Str, AnsiStrPos returns nil (Delphi) or NULL (C++). 

Unlike the StrPos function, AnsiStrPos works with multi-byte characters sets (MBCS). 

 

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