HELP: String manipulation question from a newbie

Bill Scherer Bill.Scherer at VerizonWireless.com
Wed Aug 16 12:02:16 EDT 2000


import string
URL = string.replace(URL, 'body_', '')


will do it.


namking at my-deja.com wrote:

> Hi, please help me,
> I don't need to learn python, and indeed I don't have the time to
> All I need to do is insert a few lines into a pre-existing program that
> will:
>
> find the first occurrence of the substring "body_" in a string (called
> URL)
> and strip it out,
>
> e.g. if URL="http://www.xxx.com/body_welcome.html" I want to change it
> to "http://www.xxx.com/welcome.html".
>
> Cany anyone help me?
> Niall
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> --
> http://www.python.org/mailman/listinfo/python-list

--
William K. Scherer
Sr. Member of Applications Staff - Verizon Wireless
Bill.Scherer_at_VerizonWireless.com







More information about the Python-list mailing list