question

YHY-1161 avatar image
0 Votes"
YHY-1161 asked YHY-1161 commented

What does it mean to say that strings are immutable in C#.

Please help! I would appreciate that.

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

WayneAKing-0228 avatar image
0 Votes"
WayneAKing-0228 answered YHY-1161 commented

String Class
https://docs.microsoft.com/en-us/dotnet/api/system.string?view=net-5.0

"A String object is called immutable (read-only), because its
value cannot be modified after it has been created. Methods
that appear to modify a String object actually return a new
String object that contains the modification."

  • Wayne




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I appreciate for your answer! I have one more question for you. I would like to know what late variable initialization is.

0 Votes 0 ·