C#——string.IsNullOrEmpty做什么用的

判断字符串是否为空字符串


空字符串有两种情况,一种为字符串里的值为空字符串,另一种是没有给字符串分配任何的值


比如:
string s1="";
string s2;
如果用IsNullOrEmpty来判断这两个字符串的话,都返回true

猜你喜欢

转载自blog.csdn.net/lmm0513/article/details/88773461