语法
<test> ? <resultIfTrue> : <resultIfFalse>
示例
string resStr = (myInteger<10) ? "Less than 10":"Greater than or equal to 10";
语法
<test> ? <resultIfTrue> : <resultIfFalse>
示例
string resStr = (myInteger<10) ? "Less than 10":"Greater than or equal to 10";
转载于:https://www.cnblogs.com/wuxiaohui1983/p/9969630.html