multiline strings and proper indentation/alignment

John Salerno johnjsal at NOSPAMgmail.com
Wed May 10 11:50:38 EDT 2006


Dave Hansen wrote:

>>>> print textwrap.dedent(s).strip().replace('\n',' ')
> this is a multiline triple-quted string with indentation for nicer
> code formatting

But I have some newlines that are already embedded in the string, and I 
wouldn't want those replaced.



More information about the Python-list mailing list