Show: Delphi C++
Display Preferences

System.Pos

From RAD Studio API Documentation
Jump to: navigation, search

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

Locates a substring in a given string.

The Pos method returns an index of the first occurence of Substr in Str, starting the search at Offset.

This method returns zero if Substr is not found or Offset is invalid (for example, if Offset exceeds the String length or is less than 1).

Note: The System.StrUtils.PosEx function is similar to Pos, but it provides additional features and can be used in C++ code.

See Also

Code Examples


Personal tools
Translations