1、?
x==1 ? "man" : "men"
判断当x==1 为真时,返回"man"值,当x==1为假时,返回"men"值。
2、is
if(i is object)
如果 i 为object类型,返回true,否则返回false。
3、as
object1 as string
将object1转换为string类型,如果不能直接转换,则返回null。
1、?
x==1 ? "man" : "men"
判断当x==1 为真时,返回"man"值,当x==1为假时,返回"men"值。
2、is
if(i is object)
如果 i 为object类型,返回true,否则返回false。
3、as
object1 as string
将object1转换为string类型,如果不能直接转换,则返回null。