当前位置: 首页 > news >正文

网游开发seo与网站优化

网游开发,seo与网站优化,免费的网站在哪里下载,网站建立公司 优帮云C# 9 新特性 —— 增强的模式匹配IntroC# 9 中进一步增强了模式匹配的用法#xff0c;使得模式匹配更为强大#xff0c;我们一起来了解一下吧SampleC# 9 中增强了模式匹配的用法#xff0c;增加了 and/or/not 操作符#xff0c;而且可以直接判断属性#xff0c;来看一下下… C# 9 新特性 —— 增强的模式匹配IntroC# 9 中进一步增强了模式匹配的用法使得模式匹配更为强大我们一起来了解一下吧SampleC# 9 中增强了模式匹配的用法增加了 and/or/not 操作符而且可以直接判断属性来看一下下面的这个示例var person  new Person();// or // string.IsNullOrEmpty(person.Description) if (person.Description is null or { Length: 0 }) {Console.WriteLine(${nameof(person.Description)} is IsNullOrEmpty); }// and // !string.IsNullOrEmpty(person.Name) if (person.Name is not null and { Length:  0 }) {if (person.Name[0] is ( a and  z) or ( A and  Z) or .){} }// not if (person.Name is not null) { } 这里的代码使用 DnSpy 反编译之后的代码是下面这样的Person person  new Person(); string text  person.Description; bool flag  text  null || text.Length  0; if (flag) {Console.WriteLine(Description is IsNullOrEmpty); } text  person.Name; bool flag2  text ! null  text.Length  0; if (flag2) {char c  person.Name[0];if (c  a){if (c  z){goto IL_8B;}}else if (c  A){if (c  Z){goto IL_8B;}}else if (c ! ,  c ! .){goto IL_8B;}bool flag3  true;goto IL_8E;IL_8B:flag3  false;IL_8E:bool flag4  flag3;if (flag4){} } bool flag5  person.Name ! null; if (flag5) { } Switch这不仅适用于 is 也可以在 switch 中使用switch (person.Age) {case  0 and  3:Console.WriteLine(baby);break;case  3 and  14:Console.WriteLine(child);break;case  14 and  22:Console.WriteLine(youth);break;case  22 and  60:Console.WriteLine(Adult);break;case  60 and  500:Console.WriteLine(Old man);break;case  500:Console.WriteLine(monster);break; } 反编译后的代码int age  person.Age; int num  age; if (num  22) {if (num  14){if (num  0){if (num  3){Console.WriteLine(child);}else{Console.WriteLine(baby);}}}else if (num  14){Console.WriteLine(youth);} } else if (num  60) {if (num  22){Console.WriteLine(Adult);} } else if (num  500) {Console.WriteLine(monster); } else {Console.WriteLine(Old man); } More可以看到有些情况下可以简化不少代码尤其是 if 分支比较多的情况下使用上面 switch 这样的写法会清晰很多但是如果只是 string.IsNullOrEmpty 这种代码最好还是不要写得这么骚了小心要被同事吐槽了炫技需谨慎小心被 ...Referencehttps://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9https://github.com/WeihanLi/SamplesInPractice/tree/master/CSharp9Samplehttps://github.com/WeihanLi/SamplesInPractice/blob/master/CSharp9Sample/PatternMatchingSample.cs
http://wiki.neutronadmin.com/news/234738/

相关文章:

  • 网站推广存在的问题网站攻击一般有那些
  • wordpress网站载入慢竹制品网站怎么做
  • 电子商务网站推广的主要方式国家企业信用平台官网
  • 网站建设意见反馈表公司网站链接怎么弄
  • 做个网站应该怎么做那个网站可以查询美做空基金
  • 天津企业网站建设个人网站做什么好
  • 网站的底部导航怎么做免费网站模板素材
  • 托管竞价账户哪家好昆明市网络优化案例
  • 网站建设毕业答辩ppt模板下载wordpress 获取有图片的文章
  • 做网站怎样盈利服务器网站维护
  • 因网站建设关闭的公告精品课程网站开发的创新点
  • 移动互联网 商业模式北京百度关键词优化
  • 网站如何启用gzip压缩wordpress页面原文件
  • 如何建设高等数学课程网站企业管理咨询公司简介
  • 郴州市宜章网站建设织梦网站 联系方式修改
  • 手机网站制作哪家好对网站开发流程的了解
  • 上不了国外网站怎么做外贸数字重庆公司
  • 个人博客网站取名济南教育论坛网站建设
  • 山东网站建设哪家公司好最新手机发布会
  • 网站建设前端切图廊坊高端品牌网站建设
  • 沈阳做网站哪家公司好手机电脑网站
  • 免费网站代理访问wordpress内容打不开
  • 社区做图网站有哪些内容幼儿保育专业建设规划
  • 汽车网址永州seo快速排名
  • 网站安全建设方案需求分析福州网站建设
  • 手机网站设计公司可去亿企邦wordpress卡蜜主题
  • 零成本游戏网站开发o2o网站建设基本流程
  • 建设电影网站视频素材怎么修改wordpress模板文件路径
  • 项目经理接到网站开发怎么开展1元2元店5元店进货渠道大全
  • 深圳住房网站app石化建设分会网站