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

IsNaturalNumber() public static method

Determines whether a number is a natural number (positive, non-decimal)
public static IsNaturalNumber ( this sItem ) : bool
sItem this The s item.
return bool
        public static bool IsNaturalNumber(this string sItem)
        {
            Regex notNaturalPattern = new Regex("[^0-9]");
            Regex naturalPattern = new Regex("0*[1-9][0-9]*");

            return !notNaturalPattern.IsMatch(sItem) && naturalPattern.IsMatch(sItem);
        }