'string'.strip(chars)-like function that removes from the middle?
ethan at stoneleaf.us
Tue Jun 17 21:42:20 CEST 2008
Ethan Furman wrote:
> The strip() method of strings works from both ends towards the middle.
> Is there a simple, built-in way to remove several characters from a
> string no matter their location? (besides .replace() ;)
> For example:
> .strip --> 'www.example.com'.strip('cmowz.')
> .??? --> --- 'www.example.com'.strip('cmowz.')
Thanks for all the ideas!
More information about the Python-list