private void ReadHex() { while (char.IsLetterOrDigit(this.reader.Current)) { int num = (int)this.reader.Read(); } string text = this.reader.GetString(this.startPos + 2, this.reader.Position); foreach (char ch in text) { if (!Utils.IsHexDigit(ch)) { throw LexicalException.InvalidHex(text); } } }
void ReadHex() { while (char.IsLetterOrDigit(this.reader.Current)) { this.reader.Read(); } string s = this.reader.GetString(this.startPos + 2, this.reader.Position); // skip leading 0x foreach (char ch in s) { if (!Utils.IsHexDigit(ch)) { throw LexicalException.InvalidHex(s); } } }