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

asked 2021-04-21T21:47:32.18+00:00
YHY 41 Reputation points

Please help! I would appreciate that.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
6,929 questions
No comments
{count} votes

Accepted answer
  1. answered 2021-04-22T00:26:17.53+00:00
    WayneAKing 4,246 Reputation points

    String Class
    https://learn.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

0 additional answers

Sort by: Most helpful