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
     
     
  • 相关阅读:
    mysql has gone away
    [置顶] 在Visual Studio 2008上调试C语言程序
    滚动加载更多内容
    【jeecg-mybatis版本】 mybatis+spring mvc 完美整合方案 查询,保存,更新,删除自动生成
    Android Developers:按钮
    java 从零开始,学习笔记之基础入门<集合>(十六)
    Ubuntu MYSQL环境搭建
    Android 如何预置APK M
    php基础系列:从用户登录处理程序学习mysql扩展基本操作
    CMUSphinx Learn
  • 原文地址:https://www.cnblogs.com/RocCnBlog/p/14079520.html
Copyright © 2011-2022 走看看