C# String.IsNullOrEmpty()方法的使用

2022-12-04,

IsNullOrEmpty(string)是String类的一个有参的方法,方法需要类的调用,所以String.IsNullOrEmpty(string)

IsNullOrEmpty是判断字符串的Null值和""值。如果字符串为空或为""都返回true。
string.IsNullOrEmpty(null)---返回true
string.IsNullOrEmpty("")---返回true

if (String.IsNullOrEmpty(str))
返回false,才表示str即不为空也不为""。

C# String.IsNullOrEmpty()方法的使用的相关教程结束。

《C# String.IsNullOrEmpty()方法的使用.doc》

下载本文的Word格式文档,以方便收藏与打印。