private static bool IsNumeric(string value) { if (string.IsNullOrWhiteSpace(value)) { return false; } foreach (var character in value) { if (!char.IsDigit(character)) { return false; } } return true; }