.NET Framework 类库
String.IsNullOrEmpty 方法

注意:此方法在 .NET Framework 2.0 版中是新增的。

指示指定的 String 对象是 空引用(在 Visual Basic 中为 Nothing) 还是 Empty 字符串。

命名空间:System
程序集:mscorlib(在 mscorlib.dll 中)

语法

C#
public static bool IsNullOrEmpty
( string value )

参数

value
               一个 String 引用。
返回值

              如果 value 参数为 空引用(在 Visual Basic 中为 Nothing) 或空字符串 (""),则为 true;否则为 false

备注

             IsNullOrEmpty 是一种简便方法,它使您能够同时测试 String 是否为 空引用(在 Visual Basic 中为 Nothing) 或其值是否为 Empty

相关文章:

  • 2022-01-17
  • 2022-12-23
  • 2021-10-22
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2021-07-06
  • 2021-10-07
  • 2021-08-08
  • 2021-08-01
  • 2022-01-04
相关资源
相似解决方案