public static bool IsNullOrEmpty(string value) { if (value != null) { return (value.Length == 0); } return true; }
不要再傻着写下:
if (string.IsNullOrEmpty(s) || s.Length == 0)
这样的C#代码了,会被耻笑的!
哎! 还是多熟悉.NET Framework吧
public static bool IsNullOrEmpty(string value) { if (value != null) { return (value.Length == 0); } return true; }
不要再傻着写下:
if (string.IsNullOrEmpty(s) || s.Length == 0)
这样的C#代码了,会被耻笑的!
哎! 还是多熟悉.NET Framework吧
转载于:https://www.cnblogs.com/kevin11681/archive/2010/03/23/1692663.html