> 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