C# Tips

Today's C# Quiz

Quiz

One of the following C# codes returns different result than others. What is it?

return s ?? "Empty";
return (s == null) ? "Empty" : s;
return (string.IsNullOrEmpty(s)) ? "Empty" : s;
if (s == null) return "Empty"; else return s;

Tip

Answer