Skip to main content

dedent_initial

Remove indentation from first line of text.

def dedent_initial(
s: string,
n: integer = 4
) - > string

Remove indentation from first line of text.

Parameters​

NameTypeDescription
sstringThe input string whose first line will be processed for indentation removal.
ninteger = 4The number of leading spaces to check for and remove from the start of the string.

Returns​

TypeDescription
stringThe modified string with the leading spaces removed if the indentation matched, otherwise the original string.