acidbase.str_pad

acidbase.str_pad(string: str, width: int, side: str = 'left', pad: str = ' ') str

Pad a string to a minimum width.

Parameters:
  • string (str) – Input string.

  • width (int) – Desired minimum width of the output.

  • side (str) – One of ‘left’, ‘right’, or ‘both’.

  • pad (str) – Single character used for padding.

Returns:

Padded string.

Return type:

str