[Tutor] strip function

Norman Khine norman at khine.net
Wed Dec 24 13:25:51 CET 2008


Hello,
I have difficulties in trying to stripping the following:

 >>> item_path = '/companies/company/news'
 >>> item_strip = item_path.strip('/companies')
 >>> item_strip
'y/new'
 >>>

I would like to return:

 >>> item_strip
'/company/news'

What is the best way to do this.

Thanks



More information about the Tutor mailing list