且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查一个C#变量是一个空字符串""还是空?

更新时间:2023-02-22 13:18:33

 如果(string.IsNullOrEmpty(MyString的)){
//
}


Possible Duplicate:
Easier way of writing null or empty?

I am looking for the simplest way to do a check. I have a variable that can be equal to "" or null. Is there just one function that can check if it's not "" or null?

if (string.IsNullOrEmpty(myString)) {
   //
}