Original post

imagine I have a str = a very long string, and I want to change one char in that very long string. From what I’m reading strings are immutable, so I will have to create a modified copy of str something like this: `newstr = str[:10] + ‘x’ + str[11:]

This is all fine until str is 2gb of a string. Then it becomes a very inefficient way of changing a single char in a string. In c/c++ you would just do:

str[10] = 'x';