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
     
     
  • 相关阅读:
    nuget
    C#枚举中使用Flags特性
    情感分析
    docker
    core部署
    脱壳系列_2_IAT加密壳_详细分析(含脚本)
    安全公司-* * * *-面试题:_ 安卓逆向分析分享
    18_ShadowWalker
    17_页面异常接管
    16_TLB与流水线
  • 原文地址:https://www.cnblogs.com/RocCnBlog/p/14079520.html
Copyright © 2011-2022 走看看