On Wed, Dec 24, 2008 at 7:25 AM, Norman Khine wrote:
>
> 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'
strip() doesn't do what you want. It removes any of th
Norman Khine wrote:
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'
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
___