131-三元运算符

语法
<test> ? <resultIfTrue> : <resultIfFalse>

示例

string resStr = (myInteger<10) ? "Less than 10":"Greater than or equal to 10";

  

posted @ 2018-11-16 15:34  阿晖2222  阅读(99)  评论(0编辑  收藏  举报