string nickName = " ";if (nickName.Trim() == string.Empty) { } else { } 转载于:https://www.cnblogs.com/luguoshuai/p/8651026.html