I usually use something like this for various reasons throughout an application:
if (String.IsNullOrEmpty(strFoo)) { FooTextBox.Text = \"0\"; } else {
You can achieve this with pattern matching with the switch expression in C#8/9
FooTextBox.Text = strFoo switch { { Length: >0 } s => s, // If the length of the string is greater than 0 _ => "0" // Anything else };