AnsiMidStr

Returns a number of characters copied from a given location in a string

Declaration

Source position: strutils.pp line 93

  function AnsiMidStr(const AText: AnsiString; const AStart: SizeInt; 
                     const ACount: SizeInt) : AnsiString;

Description

AnsiMidStr returns ACount characters from AText, starting at position AStart. If AStart+ACount is larger than the length of AText, only as much characters as available in AText (starting from AStart) will be copied. If ACount is zero or negative, no characters will be copied. The characters are counted as characters, not as Bytes.

This function corresponds to the Visual Basic MidStr function.

Errors

None

See also

Name Description
AnsiLeftStr Copies a number of characters starting at the left of a string
AnsiRightStr Copies a number of characters starting at the right of a string
LeftBStr Copies Count characters starting at the left of a string.
LeftStr Copies Count characters starting at the left of a string.
MidBStr Copies a number of characters starting at a given position in a string.
MidStr Copies a number of characters starting at a given position in a string.
RightBStr Copy a given number of characters (bytes), counting from the right of a string.
RightStr Copy a given number of characters, counting from the right of a string.