[docs] [issue25433] whitespace in strip()/lstrip()/rstrip()

Elliot Edmunds report at bugs.python.org
Tue Aug 28 14:25:07 EDT 2018


Elliot Edmunds <edmundselliot at gmail.com> added the comment:

Not sure how helpful it would be to have the re.sub expressions for lstrip and rstrip, but I think it would look like:

l_stripped = re.sub(r'^\s*', '', foo)
r_stripped = re.sub(r'\s*$', '', foo)

----------
nosy: +Elliot Edmunds
Added file: https://bugs.python.org/file47769/whitespace_regex.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25433>
_______________________________________


More information about the docs mailing list