首页 优化推广 String.IsNullOrEmpty 方法

String.IsNullOrEmpty 方法

来源: | 时间:2013/10/30 9:16:36 |

指示指定的字符串是 null 还是 Empty 字符串。其实就是判断字符串是空引用,或值为空。如刚定义一个字符串就是Empty(空)的。

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

IsNullOrEmpty 是一种简便方法,它使您能够同时测试 String 是否为 null 或其值是否为 Empty 它与下列代码等效:

result = s == null || s == String.Empty;

语法:

public static bool IsNullOrEmpty(
 string value
)

参数

value
类型:System.String
要测试的字符串。

服务热线

153 8323 9821

功能和特性

价格和优惠

网站和维护

推广和优化

微信服务号