在 C# 中,“<"是什么意思??:"? [英] In c# what does mean "< ? :"?
本文介绍了在 C# 中,“<"是什么意思??:"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 C# 中 <?: 在这个字符串中?
In c# what does mean < ? : in this string?
return (a < b ? c: "text") + " ";
推荐答案
condition ? truePart : falsePart
这意味着如果 a
小于 b
则返回 c
否则返回 "text"
.两个值都将在返回之前附加 " "
...
It means if a
is less then b
then return c
else return "text"
. Both values will have " "
appended before returning...
哦,但是请不要在你自己的代码中使用变量名 a
、b
和 c
:)
Oh, but please don't use the variable names a
, b
and c
in your own code :)
这篇关于在 C# 中,“<"是什么意思??:"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文