.NET Framework 4.0 Newbie : StringBuilder.New

.NET Framework 4.0 Newbie : StringBuilder.New

  • Comments 0

In .NET Framework 4.0 we have an option to clear StringBuilder class. Unlike previous versions where we used to write StringBuilder.Length = 0 to clean, now we can implement a new method called Clear().

 

var sBulder = new StringBuilder();

 

sBulder.Append("Anyhting");

sBulder.Append("Again another");

 

//Previous approach to clear up StringBuilder

sBulder.Length = 0;

 

//New approach to clean string builder

sBulder.Clear();

 

 

Namoskar!!!

Leave a Comment
  • Please add 3 and 5 and type the answer here:
  • Post