Guest User
Is string mutable or immutable?
By Guest User in C# on Aug 01 2014
  • Ankur Jain
    Aug, 2014 18

    The main difference is system.string is immutable and system.stringbuilder is a mutable. Append keyword is used in string builder but not in system.string. Immutable means once we created we cannot modified. Suppose if we want give new value to old value simply it will discarded the old value and it will create new instance in memory to hold the new value.

    • 3
  • manikumar maddu
    Aug, 2014 5

    All string objects are immutable in C#.

    • 2
  • Abhishek Kumar
    Feb, 2016 4

    strings are always imutable

    • 1
  • Joe Wilson
    Dec, 2015 24

    Immutable

    • 1
  • sajidlkhan lodi
    Feb, 2015 9

    string iobjects are always immutable

    • 1
  • Michael O
    Jun, 2015 20

    String objects are NOT ALWAYS immutable. Ignore all posts in this thread that spread this misconception. Below for example I show an example where I take "thequickbrownfox" and change each character in turn into "THEQUICKBROWNFOX" The original string is mutable in this example. String s = "thequickbrownfox"; Console.WriteLine(s); unsafe { fixed (char* ca = s) for (char* c = ca; *c != 0; c++) *c = char.ToUpper(*c); } Console.WriteLine(s);

    • 0
  • Safayat Zisan
    Apr, 2015 22

    Strings are always immutable

    • 0
  • Kml Surani
    Apr, 2015 14

    Immutable string can’t be alter, once we have assign a value to immutable object state can’t be changedWe can assign multiple values to mutable string and object state can be altered.

    • 0
  • sajidlkhan lodi
    Feb, 2015 9

    string objects are always immutable

    • 0
  • sajidlkhan lodi
    Feb, 2015 9

    string iobjects are always immutable

    • 0
  • sajidlkhan lodi
    Feb, 2015 9

    string iobjects are always immutable

    • 0
  • Ravi Prajapati
    Dec, 2014 16

    string is immutable , can not change value

    • 0
  • Ravi Prajapati
    Dec, 2014 16

    string is immutable , can not change value

    • 0
  • Gokul Rathod
    Nov, 2014 25

    immutable

    • 0
  • Dhanik Sahni
    Oct, 2014 9

    Yes String are immutable.

    • 0
  • Munesh Sharma
    Oct, 2014 9

    system.string is immutable

    • 0
  • Akhil Garg
    Sep, 2014 14

    Yes String are immutable.

    • 0
  • Sunil Gaded
    Aug, 2014 28

    Immutable,so that they are used for smaller operation

    • 0
  • venky prasad
    Aug, 2014 26

    All strings are immutable.because if you try to insert a value more than once it will replace previous value.String Builders are mutable.

    • 0
  • varunkumar reddy
    Aug, 2014 23

    Yes string is a immutable

    • 0
  • Najna Abdulla
    Aug, 2014 20

    Immutable means string values cannot be changed once they have been created. Any modification to a string value results in a completely new string instance, thus an inefficient use of memory and extraneous garbage collection. The mutable System.Text.StringBuilder class should be used when string values will change.

    • 0
  • Payal Sharma
    Aug, 2014 11

    mutable

    • 0
  • shashi p
    Aug, 2014 7

    String is Immutable, They cannot be altered

    • 0
  • Guest User
    Aug, 2014 1

    mutable means "changeable" and immutable is acronym of that.strings are immutable.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS