Sign in Join
FPDoc Onlineexperiment

PadLeft function

In unit StrUtils

Add spaces to the left of a string till a certain length is reached.

Declaration

pascal
function PadLeft(const S: string; N: Integer): string

Arguments

S

String to pad.

N

Minimal length of the resulting string.

Function result

String of length N, padded to the left with spaces.

Description

PadLeft add spaces to the left of the string S till the result reaches length Len. If the string S has length equal to or larger than Len, no spaces are added, and the string S is returned as-is. The resulting string is S, right-justified on length Len.

Errors

None.

See also

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