Template:Str pad/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Pads a string to a certain length with a certain fill.

Examples

[edit source]

{{str pad|str=a|len=10|fill=b}} → abbbbbbbbb

{{str pad|str=a|len=10|fill=b|mode=start}} → bbbbbbbbba

{{str pad|str=a|len=10|fill=ab|mode=start}} → ababababaa

Template Data

[edit source]

Pads a string to a certain length with a certain fill.

Template parameters

ParameterDescriptionTypeStatus
strstr

The string to pad

Example
Hello world!
Stringoptional
lenlen

The length of the padded string

Default
0
Example
10
Numberoptional
fillfill

The padder string

Example
.
Stringoptional
modemode

The mode to use for padding

Default
end
Example
start
Stringoptional