Common String methods in C#.
Manipulation:
1string s = "Hello, World!";2s.ToLower(); // "hello, world!"3s.ToUpper(); // "HELLO, WORLD!"4s.Trim(); // "Hello, World!"5s.Replace("World", "C#"); // "Hello, C#!"
Search:
1s.Contains("World"); // true2s.StartsWith("Hello"); // true3s.EndsWith("!"); // true4s.IndexOf("World"); // 7
Substring:
1s.Substring(7, 5); // "World"2s[..5]; // "Hello" (range)3s[7..]; // "World!" (range)4s.Split(','); // ["Hello", " World!"]
Check:
1string.IsNullOrEmpty(s); // false2s.IsNullOrWhiteSpace(s); // false3s.ToCharArray(); // char array