A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-July/026954.html below:

[Python-Dev] Multiline string constants, include in the standard library?

[Python-Dev] Multiline string constants, include in the standard library? [Python-Dev] Multiline string constants, include in the standard library?Ville Vainio ville.vainio@swisslog.com
Fri, 26 Jul 2002 10:11:41 +0300
>     where stripIndent() has been defined as:
>
>     >>> def stripIndent( s ):
>     ...     indent = len(s) - len(s.lstrip())
>     ...     sLines = s.split('\n')
>     ...     resultLines = [ line[indent:] for line in sLines ]
>     ...     return ''.join( resultLines )


Something like this should really be available somewhere in the standard 
library (string module [yeah, predeprecation, I know], string method). 
Everybody needs this kind of functionality, and probably more often than 
many of the other string methods (title, swapcase come to mind).

-- Ville




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4