You can use the ternary operator:
string test = "It's a test";
string test2 = (test != "") ? test : "0-length string";
5
solved C# Shorten if statement
You can use the ternary operator:
string test = "It's a test";
string test2 = (test != "") ? test : "0-length string";
5
solved C# Shorten if statement