Strings In Depth12 / 18
Up next

Trim and blank checks

var s = "  Hello  ";
Console.WriteLine($"[{s.Trim()}]");
// treats null, empty, and all-whitespace as blank
Console.WriteLine(string.IsNullOrWhiteSpace("   "));
What you're solving

clean up whitespace