HELP: String manipulation question from a newbie
Kalle Svensson
kalle at gnupung.net
Wed Aug 16 12:09:41 EDT 2000
More information about the Python-list mailing list
Wed Aug 16 12:09:41 EDT 2000
- Previous message (by thread): HELP: String manipulation question from a newbie
- Next message (by thread): HELP: String manipulation question from a newbie
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 16 Aug 2000 namking at my-deja.com wrote: > 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". URL = string.replace(URL, "body_", "", 1) For this to work, you have to import the string module somewhere in your program, perhaps at the top (there should be a number of import statements there already, just add the module "string"). HTH, Kalle Svensson -- Email: kalle at gnupung.net | You can tune a filesystem, but you Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
- Previous message (by thread): HELP: String manipulation question from a newbie
- Next message (by thread): HELP: String manipulation question from a newbie
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list