Sign in Join
FPDoc Onlineexperiment

AnsiMidStr function

In unit StrUtils

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

Declaration

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

Arguments

AText

String from which to copy.

AStart

1-based location in the string where to copy from.

ACount

Number of characters to copy.

Function result

The resulting string.

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.