C#判断一个字符串是否全部为空格的一个简单方法

 string nickName = "     ";
if (nickName.Trim() == string.Empty) { } else { }