Functions Language

PadLeft

The PadLeft() function adds a specified character to the start of a string until the string reaches a specified total length.

Related functions: PadRight


Syntax:

PadLeft(String, Length, PadChar)
  • In the Quintessence Editor (Studio) using Python language, use: Qx.PadLeft()
 See parameter descriptions

StringThe input text.
LengthThe desired total length of the output string (in characters).
PadCharThe character to prepend to the string until the required length is reached.

Remarks:

  • If the input string is already longer than the specified final length, the original string is returned unchanged.

Examples:

The examples provided below are based on fictitious data for illustrative purposes only.

> Example 1: Add characters to the left of a string


Formula:

return := PadLeft("ABC", 6, "0");

Result:

000ABC