String Splice Assignment

eAndroid gervaserules at yahoo.com
Mon Jul 16 17:57:06 EDT 2001


Why don't strings support splice assignment, and what are some
alternatives?

I would expect it would work like this:

>>> a = 'asdf'
>>> a[1:2] = "EFGH"
>>> a
'aEFGHf'

I have a long string (~1000 chars) that I would like to do multiple
splice assignments on. I am now interested alternatives to do this,
especially efficient ones.

Thanks,

nathan



More information about the Python-list mailing list