center
Center the value in a field of a given width.
def center(
value: string,
arg: integer
) - > string
Center the value in a field of a given width.
Parameters
| Name | Type | Description |
|---|---|---|
| value | string | The string content to be centered within the output field. |
| arg | integer | The total width of the resulting field; if this value is greater than the length of the input, padding is added. |
Returns
| Type | Description |
|---|---|
string | The original string padded with spaces on both sides to reach the specified width, or the original string if the width is less than or equal to zero. |