padleft() Function

Function

padleft( text, length )

Pads text with spaces on the left so that it is a certain length.

Parameters

Keyword Type Description

text

Text

The text to be padded.

length

Number

The target number of characters desired in the final text.

Returns

Text

Usage considerations

Padding and text length

Spaces will be added until the text has the number of characters entered for the length parameter.

Text longer than the specified length remains untouched.

Examples

You can experiment with this function in the test box below.

Test Input

padleft("boston",10) returns     boston

Open in Github Built: Thu, Oct 14, 2021 (02:44:31 PM)

On This Page

FEEDBACK