Strings are immutable once they are created they cannot be changed
The functions that are used to modify string all return a new string (String is immutable)
String methods can be chained one after the other
String Formatting
- String can be concatenated using the ”+” operator but this can get messy very quickly
- Instead we can make use of
String.Format()
to format a string as required - String Interpolation can also be used for formatting string. Iet is created by adding
$
before the string
Standard numeric format strings | Microsoft Docs
Verbatim Strings
- They are string that output the value as it is special characters are not considered
- They are similar to raw strings/ triple quote strings in Python
String Builder Class
- It is a class that is used to create Mutable String
- It is defined in the
System.Text
namespace - It does not provide any of the String Searching Methods but in place of that provides String Manipulation Methods
- We are going to do a lot of manipulation of the data then string builder class should be used as they are faster and more efficient