Aqueduct.Extensions.Numeric.IsInteger C# (CSharp) Method

IsInteger() public static method

Determines whether the specified s item is integer.
public static IsInteger ( this sItem ) : bool
sItem this The s item.
return bool
        public static bool IsInteger(this string sItem)
        {
            Regex notIntPattern = new Regex("[^0-9-]");
            Regex intPattern = new Regex("^-[0-9]+$|^[0-9]+$");

            return !notIntPattern.IsMatch(sItem) && intPattern.IsMatch(sItem);
        }