System.Pos
From RAD Studio API Documentation
Delphi
function Pos(const SubStr, Str: _ShortStr; Offset: Integer): Integer; function Pos(const SubStr, Str: UnicodeString; Offset: Integer): Integer; overload; function Pos(const SubStr, Str: _WideStr; Offset: Integer): Integer; overload; function Pos(const SubStr, Str: _RawByteStr; Offset: Integer): Integer;
C++
extern DELPHI_PACKAGE int __fastcall Pos(const ShortString &SubStr, const ShortString &Str, int Offset = 0x1)/* overload */;
Contents |
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.pas System.hpp |
System | System |
Description
Returns the index value of the first character in a specified substring that occurs in a given string.
In Delphi, Pos searches for a substring, Substr, in a string, S. Substr and S are string-type expressions.
Pos searches for Substr within S and returns an integer value that is the index of the first character of Substr within S. Pos is case-sensitive. If Substr is not found, Pos returns zero.
The System.StrUtils.PosEx function is similar to Pos, but provides additional features and can be used in C++ code.
See Also
Code Examples