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:
Post a Comment