Published in: C#
public static bool IsDate(object o) { bool result; try { DateTime myDT = DateTime.Parse(o.ToString()); result = true; } catch (FormatException e) { result = false; } return result; } public static bool IsNumeric(string strNumber) { if (HasValue(strNumber)) { return Double.TryParse(strNumber, System.Globalization.NumberStyles.Any, cultureInfo.NumberFormat, out dummyOut); } else return false; }
You need to login to post a comment.
