String manipulation in C#

In C#, there are many built-in methods and functions that can be used to manipulate strings. Here are some examples:
Concatenation: To join two or more strings together, you can use the “+” operator or the String.Concat() method. For example:
string firstName = "John"; string lastName = "Doe"; string fullName = firstName + " " + lastName; // Output: "John Doe" string fullName2 = String.Concat(firstName, " ", lastName); // Output: "John Doe"
Length: To get the length of a string, you can use the Length property. For example:
string str = "Hello, World!"; int length = str.Length; // Output: 13
Substring: To get a substring from a string, you can use the Substring() method. For example:
string str = "Hello, World!"; string substring = str.Substring(7); // Output: "World!"
Replace: To replace a substring in a string, you can use the Replace() method. For example:
string str = "Hello, World!"; string newStr = str.Replace("World", "Universe"); // Output: "Hello, Universe!"