String.PadLeft

Syntax

PadLeft(Source: String; Length: Integer; [PaddingChar: Char = " "]): String;

Parameters

Source - source string.

Length - length of the string after adding characters. (The length of the source string + the number of added characters).

PaddingChar - added character.

Description

The PadLeft method adds the specified number of characters specified in the PaddingChar parameter to the left of the source string passed by the Source parameter.

Example

Sub Main;

Var

s, s1: String;

Begin

s := "abcdef";

s1 := String.PadLeft(s, s.Length + 2, 'X');

End Sub Main;

After executing the example the "s" variable will contain the XXabcdef value.

See also:

String