0

How do I return the string "test"? I'm using ?? operator and method GetStringValue returns empty string.

Current value of X is "", but it's should be "test"?

var X = GetStringValue() ?? "test";

private static string GetStringValue()
{
   return string.Empty;
}
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user584018
  • 10,186
  • 15
  • 74
  • 160

0 Answers0