C# a == b ? c :d 表示的意思

a==b 为true,这个表达式返回c;

a==b为false,这个表达式返回d.

相当于:

if(a == b)

{

  return c;

}

else

{

  return d;

}

原文地址:https://www.cnblogs.com/Peng18233754457/p/9273868.html