流浪のwolf

卷帝

导航

C # 的 IsNullOrEmpty

作用:判断字符串是否是 null 或者 ”“ 如果是 null or ”“ 就返回 true 

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

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

posted on 2023-09-26 15:16  流浪のwolf  阅读(376)  评论(0编辑  收藏  举报