CR LF
Gerrit Holl
gerrit at NOSPAM.nl.linux.org
Sun Aug 20 06:07:20 EDT 2000
On Sun, 20 Aug 2000 08:47:49 GMT, Simon Faulkner wrote:
> Hi All,
>
> I am printing a string to a html page and the string is correctly
> stored in the MySQL database as
>
> >>
> This string wraps onto 3 lines
> Line2
> Line3
> <<
>
> But, of course, it comes out on the web page as
>
> >>
> This string wraps onto 3 lines Line2 Line3
> <<
>
> I need to replace each return with a <BR> as I print the field.
>
> Any ideas? - what is the smart way to do this?
I think you're looking for string.replace.
>>> import string
>>> string.replace("abcba", "b", "d")
`adcda`
Please consult the manual for details.
regards,
Gerrit.
--
1011001 1101111 1110101 1110010 1110011 0101100
1000111 1100101 1110010 1110010 1101001 1110100
More information about the Python-list
mailing list