strings in .Net are immutable - i.e. you cannot change their content once
created; depending on your intended usage, you could use substring /
replace/ regex functions to create a new string based on yours, or you could
call .ToCharArray(), change the array, and then create a new string from the
array (one of the ctors accepts char[]).
Marc
"Steve" <ss*@sss.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I have this code:
string test = new string(' ', 2);
test[0] = 't';
and I'm getting a compiler error that string.this[int] is read only.
Hmmm.
Why? I didn't declare it const or readonly?