System.AnsiStrings.MidStr
Delphi
function MidStr(const AText: AnsiString; const AStart, ACount: Integer): AnsiString; overload;
C++
extern DELPHI_PACKAGE System::AnsiString __fastcall MidStr(const System::AnsiString AText, const int AStart, const int ACount)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.AnsiStrings.pas System.AnsiStrings.hpp |
System.AnsiStrings | System.AnsiStrings |
Description
Returns the substring of a specified length that appears at a specified position in a string.
MidStr returns a substring of 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.