On Jun 16, 2008, at 12:58 PM, Ethan Furman wrote:
Greetings.
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.')
'example'
.??? --> --- 'www.example.com'.strip('cmowz.')
'exaple'
>>> re.sub('|'.join('cmowz.'), "www.example.com")
'.exaple.'
--
Ethan
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list