分类:
ASP.NET
判断字符串是否为null或为空.判断为空操作前先进行了Trim操作。 public static bool IsNullOrEmpty(this string source) { return string.IsNullOrEmpty(source); } 判断字符串是否为整型 public static bool IsInteger(this string source) { if (string.IsNullOrEmpty(source)) { return false; } int i; return Int32.TryParse(source, out i); }
评价