我们都知道,string.IsNullOrEmpty方法是判断字符串是否为:null或者string.Empty;string.IsNullOrWhiteSpace方法是判断null或者所有空白字符,功能相当于string.IsNullOrEmpty和str.Trim().Length总和。
也就是说如果字符串未连续的空格的话,是可以通过string.IsNullOrEmpty 的。而不会通过string.IsNullOrWhiteSpace
我们都知道,string.IsNullOrEmpty方法是判断字符串是否为:null或者string.Empty;string.IsNullOrWhiteSpace方法是判断null或者所有空白字符,功能相当于string.IsNullOrEmpty和str.Trim().Length总和。
也就是说如果字符串未连续的空格的话,是可以通过string.IsNullOrEmpty 的。而不会通过string.IsNullOrWhiteSpace