C # 的 IsNullOrEmpty
作用:判断字符串是否是 null 或者 ”“ 如果是 null or ”“ 就返回 true
IsNullOrEmpty是判断字符串的Null值和""值。如果字符串为空或为""都返回true。
string.IsNullOrEmpty(null)---返回true
string.IsNullOrEmpty("")---返回true
if (String.IsNullOrEmpty(”str“))
返回false,才表示str即不为空也不为""
卷帝
作用:判断字符串是否是 null 或者 ”“ 如果是 null or ”“ 就返回 true
IsNullOrEmpty是判断字符串的Null值和""值。如果字符串为空或为""都返回true。
string.IsNullOrEmpty(null)---返回true
string.IsNullOrEmpty("")---返回true
if (String.IsNullOrEmpty(”str“))
返回false,才表示str即不为空也不为""