C# ??操作符

来源:互联网 发布:python requests的功能 编辑:程序博客网 时间:2024/06/01 08:20
            //C# ??操作符 左边是否为空 如果左右为空 则使用右边            string num01 = null;            string num02 = "你好!";            string action = num01 ?? num02;

    string tmd = String.Empty;            if (Request["Select"] != null)            {                tmd = Request["Select"];            }            else            {                tmd = "All";            }            string tmd1 = Request["Select"] ?? "All";


	
				
		
原创粉丝点击