rpad - luxembourg/muxcode-clm GitHub Wiki

RPAD()

FUNCTION: rpad(<string>, <width>[, <fill>])

This function right-justifies <string> within a <width>-sized field. That is, it positions <string> visually in the right-most part of a <width>-sized field.

The background of this field is specified by a repeating pattern of <fill> characters. The origin of this repeating pattern is at the first position of the field. Another way of saying this is that the repeating pattern starts in first position and repeats to the right. The last <fill> pattern may be truncated.

By default, <fill> is a single, normal-colored space. The color of <string> and <fill> is maintained.

Unlike rjust(), if the visual width of <string> is longer than <width> characters, it is not truncated to fit.

Examples: > say -[rpad(foo,6)]- You say, "- foo-" > say %r0[rpad(foo,6)]7%r01234567 You say, " 0 foo7 01234567" > say =[rpad(bar,5,.)]= You say, "=..bar=" > say rpad(%xh%xrR%xgG%xbB,31,%xy--%xm+) --+--+--+--+--+--+--+--+--+-RGB

Related Topics: center, cpad, ljust, lpad, rjust