Modify String In Place

Sat 17 May 2025

title: "Modify String in Place" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import io
s = "Toronto is awesome"
sio = io.StringIO(s)
print(sio.getvalue())
Toronto is awesome
sio.seek(11)
sio.write("Wonderful")
9
print(sio.getvalue())
Toronto is Wonderful


Score: 5

Category: basics