We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Wednesday, July 1, 2015

String And StringBuilder

What is mean by String?
  • A string is a sequential collection of Unicode characters that is used to represent text.
  • A string object is sequential of System.Char objects that represent a string.
  • The value of the String object is the content of the sequential collection, and that values are immutable(that is, it is read-only).
  • The maximum size of a string object in memory is 2 GB or about 1 billion characters.
StringBuilder
The String object is immutable. Every time you use one of the methods in the System.sting class, you create a new string object.
  • In situations where you need to perform repeated modifications to a string, the overhead associated with creating a new String, the overhead associated with creating a new String object can be costly.
  • For example, using the StringBuilder class can boost performance when concatenating many strings together in a loop. 

No comments: