I often find myself in a need of stripping only a specified amount of
characters from a string (most commonly a single character). I have been
implementing this in an ad-hoc manner, which is quite inelegant:
def rstrip1(txt, chars):
if txt is None:
return None
elif any(txt.endswith(c) fo
Jonathan Goble wrote:
> > Do you mean "str.strip, str.lstrip, str.rstrip"?
Yes, I meant that.
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/py