Trimdent
Description
A collection of trimming and unindenting utilities.
trim :: String -> String Source #
Trims whitespace characters from both ends of the text.
>>> trim " hello " "hello"
>>>
trim " hello "
trimdent :: String -> String Source #
Smartly unindents and trims a multiline text.
>>> trimdent "\n def f():\n return 1\n" "def f():\n return 1"
trimdent "\n def f():\n return 1\n"
unindent :: String -> String Source #
Smartly unindents a multiline text.
>>> unindent "\n def f():\n return 1\n" "\ndef f():\n return 1\n"
unindent "\n def f():\n return 1\n"