- Apr 14, 2002
- 7,701
- 0
- 0
I am trying to manipulate a string within C#, and I keep getting this error:
error CS0200: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only
Here is the code snippet that is causing this:
string x = "Hello";
x[0] = 'a';
Shoudln't this work as it does in C++, giving the new value of aello to x? If not, what is the proper way of doing this?
error CS0200: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only
Here is the code snippet that is causing this:
string x = "Hello";
x[0] = 'a';
Shoudln't this work as it does in C++, giving the new value of aello to x? If not, what is the proper way of doing this?