someString[someRandomIdx] = 'g';
If it is of type
string then you can't do that because strings are immutable - they cannot be changed once they are set.
To achieve what you desire, you can use a
StringBuilder someString = new StringBuilder("someString"); someString = 'g';
Why use a
string, instead of a
StringBuilder? For lots of reasons. Here are some I can think of: