We can prove that
String is a class by looking up the
String class documentation and trying some of the methods and properties listed there.
This example uses
string s = "Hello World"; Console.WriteLine(s.Length); Console.WriteLine(s.Contains("o"));
We’ve already seen one
Empty and one
string s = String.Empty; bool isEmpty = String.IsNullOrEmpty(s);
Let’s practice using
Replace(String, String), which returns a new string with every instance of the first argument replaced by the second.
Replace all instances of
If you’re unfamiliar with
Replace(), the documentation is your best friend.