I have a line like:
string s = "abc";
And I want to change the second character to 'd', so this will be "adc" I thought this would work:
s[1] = 'd';
However, I get the error message:
Property or indexer 'string.this[int] 'cannot be assigned to -- it is read only
How can I accomplish this easy task (without using reasonably complex substring methods?
source
share