Show: Delphi C++
Display Preferences

System.Pos

From XE2 API Documentation
Jump to: navigation, search

Delphi

function Pos(const SubStr, Str: ShortString): Integer;
function Pos(const SubStr, Str: UnicodeString): Integer; overload;
function Pos(const SubStr, Str: WideString): Integer; overload;
function Pos(const SubStr, Str: RawByteString): Integer; overload;

C++

extern PACKAGE int __fastcall Pos(const ShortString &SubStr, const ShortString &Str)/* 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


Personal tools
Previous Versions
Translations