Maybe this question has been answered before, but the word if occurs so often it\'s hard to find it.
if
The example doesn\'t make sense (the expression is
Try C#7's Pattern Matching.
Using your example:
if (new StringBuilder("test") is var sb && sb != null) { Console.WriteLine(sb); }