center - luxembourg/muxcode-clm GitHub Wiki

CENTER()

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

This function centers <string> within 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.

If the visual width of <string> is longer than <width> characters, it is truncated to fit.

Example: > say center(a,5,-) You say, "--a--" > say center(BAMF,15) You say, " BAMF " > say center(%xh%xrR%xgG%xbB,31,%xy--%xm+) --+--+--+--+--RGB+--+--+--+--+-

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