Remove Common Indent

Remove the common leading whitespace from all lines in a multi-line string, normalizing indentation.

Code

General
import textwrap
return textwrap.dedent(s)

Parameters

Indented multi-line string

Server

More Python Snippets