Pages

Men

rh

6/17/2012

IsNumeric Function using C#

  public bool IsNumeric(String val)
        {
            try
            {
                double result = 0;
                return Double.TryParse(val, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.CurrentInfo, out result);
            }
            catch
            {
                return false;
            }
        }

No comments :

Post a Comment