📜  python 字符串替换索引 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:14.182000             🧑  作者: Mango

代码示例1
# strings are immutable in Python, 
# we have to create a new string which 
# includes the value at the desired index

s = s[:index] + newstring + s[index + 1:]