Skip to main content

indent

Indent text.

def indent(
t: str,
indent: int = 0,
sep: str = '\n'
) - > str

Indent text.

Parameters

NameTypeDescription
tstrThe input text to be indented
indentint = 0The number of spaces to prefix to each line of the text
sepstr = '\n'The string used to split the input text into lines and join them back together

Returns

TypeDescription
strThe resulting string with each line prefixed by the specified number of spaces