System.StrUtils.MidStr

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function MidStr(const AText: AnsiString; const AStart, ACount: Integer): AnsiString; overload;
function MidStr(const AText: string; const AStart, ACount: Integer): string; overload;

C++

extern DELPHI_PACKAGE System::AnsiString __fastcall MidStr _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (const System::AnsiString AText, const int AStart, const int ACount)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.StrUtils.pas
System.StrUtils.hpp
System.StrUtils System.StrUtils

Description

Returns the substring of a specified length that appears at a specified position in a string.

MidStr returns a substring Count characters at AText[AStart].

If AStart is larger than the length of AText, MidStr returns an empty string.

If Count specifies more characters than are available, only the characters from AText[AStart] to the end of AText are returned.

Note: If AText is an AnsiString and the current locale uses multi-byte characters, MidStr may return more than ACount bytes. To return a specific number of bytes, use MidBStr.

See Also