padLeft

Pads str to the left with padding character until it reaches length.

static pure
string
padLeft
(
string str
,
size_t length
,
char padding = ' '
)

Parameters

str string

The string to pad.

length size_t

The desired length of the resulting string.

padding char

The character to use for padding. Defaults to space.

Return Value

Type: string

The input string str padded to the left with padding character until it reaches length.

Meta