iTextSharp.text.pdf.Barcode128.IsNextDigits C# (CSharp) Method

IsNextDigits() static private method

static private IsNextDigits ( string text, int textIndex, int numDigits ) : bool
text string
textIndex int
numDigits int
return bool
        internal static bool IsNextDigits(string text, int textIndex, int numDigits) {
            int len = text.Length;
            while (textIndex < len && numDigits > 0) {
                if (text[textIndex] == FNC1) {
                    ++textIndex;
                    continue;
                }
                int n = Math.Min(2, numDigits);
                if (textIndex + n > len)
                    return false;
                while (n-- > 0) {
                    char c = text[textIndex++];
                    if (c < '0' || c > '9')
                        return false;
                    --numDigits;
                }
            }
            return numDigits == 0;
        }