📝 What is the difference between string and StringBuilder?
🔸 It's an immutable object that hold string value.
🔸 Performance wise string is slow because its' create a new instance to override or change the previous value.
🔸 String belongs to System namespace.
🔸 StringBuilder is a mutable object.
🔸 Performance wise StringBuilder is very fast because it will use same instance of StringBuilder object to perform any operation like insert value in existing string.
🔸 StringBuilder belongs to System.Text.Stringbuilder namespace.
#post
String
:🔸 It's an immutable object that hold string value.
🔸 Performance wise string is slow because its' create a new instance to override or change the previous value.
🔸 String belongs to System namespace.
StringBuilder
:🔸 StringBuilder is a mutable object.
🔸 Performance wise StringBuilder is very fast because it will use same instance of StringBuilder object to perform any operation like insert value in existing string.
🔸 StringBuilder belongs to System.Text.Stringbuilder namespace.
#post