Re: sed to python: replace Q
- From: happyriding <happyriding@xxxxxxxxx>
- Date: Tue, 29 Apr 2008 23:59:53 -0700 (PDT)
On Apr 29, 11:27 pm, Raymond <not-for-m...@xxxxxxxxx> wrote:
For some reason I'm unable to grok Python's string.replace() function.
line = "abc"
line = line.replace("a", "x")
print line
--output:--
xbc
line = "abc"
line = line.replace("[apq]", "x")
print line
--output:--
abc
Does the 5 character substring "[apq]" exist anywhere in the original
string?
.
- References:
- sed to python: replace Q
- From: Raymond
- sed to python: replace Q
- Prev by Date: Re: simple chemistry in python
- Next by Date: Re: computing with characters
- Previous by thread: Re: sed to python: replace Q
- Next by thread: Re: sed to python: replace Q
- Index(es):