Sign in Join
FPDoc Onlineexperiment

AnsiLeftStr function

In unit StrUtils

Copies a number of characters starting at the left of a string.

Declaration

pascal
function AnsiLeftStr(const AText: AnsiString; const ACount: SizeInt)
: AnsiString

Arguments

AText

String to copy characters from.

ACount

The number of characters to copy.

Function result

Resulting string contains the first ACount characters.

Description

AnsiLeftStr returns the ACount leftmost characters from AText. If ACount is larger than the length of AText, only as much characters as available in AText 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 LeftStr function.

Errors

None.

See also

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