How to replace characters in a string?

Karsten Hilbert Karsten.Hilbert at gmx.net
Wed Jun 8 05:18:08 EDT 2022


Am Wed, Jun 08, 2022 at 11:09:05AM +0200 schrieb Dave:

> myString = 'Hello'
> myNewstring = myString.replace(myString,'e','a’)

That won't work (last quote) but apart from that:

myNewstring = myString.replace('e', 'a')

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B


More information about the Python-list mailing list