zoukankan      html  css  js  c++  java
  • string.IsNullOrWhiteSpace

    测试环境:https://try.dot.net/

    Console.WriteLine(string.IsNullOrWhiteSpace(""));        -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(" "));          -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(" "));          -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(" "));          -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace("     "));   -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(" "));          -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(null));          -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(""));        -->  False          空字符   所以如果输入字符串中含有 这样的单独串,使用 string.IsNullOrWhiteSpace 是应该注意
    Console.WriteLine(string.IsNullOrWhiteSpace(" "));  -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace("v"));  -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(" "));  -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace(" "));  -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace("f"));  -->  True
    Console.WriteLine(string.IsNullOrWhiteSpace("a"));  -->  False  a   感叹号
    Console.WriteLine(string.IsNullOrWhiteSpace(""));  -->  False      退格
     
    Console.WriteLine("123"+'d');                 -->  123 d
    Console.WriteLine(("123"+'d').Length);             -->  5
    Console.WriteLine("\0"+'d');                   -->  d
    Console.WriteLine(@""+'d');                   -->  d
     
     
  • 相关阅读:
    模板引擎art-template怎么安装?
    关于vue中如何监听数组变化
    vue开发中的几个高级应用
    关于Mock.js使用
    F和Q:
    聚合和分组:
    html的或替换:
    空行替换: 替换为 :
    orm的操作:
    Hibernate中使用Criteria查询及注解——(Emp.hbm.xml)
  • 原文地址:https://www.cnblogs.com/RocCnBlog/p/14079520.html
Copyright © 2011-2022 走看看