"Raymond Hettinger" <raymond.hettinger at verizon.net> wrote: > > [Jonny Reichwald] > > I would like to suggest a small enhancement to str.strip(). > > By expanding its current form, where it only takes a char list, to > > taking any list containing either char lists or string lists, it is > > possible to remove entire words from the stripped string. > . . . > > > Would this be useful for anyone else besides me? > > Probably not. There is also the point that this functionality is a 4-line function... def trim_endings(strng, endings): for ending in endings: if ending and string.endswith(ending): return strng[:-len(ending)] - Josiah
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