當前位置: 首頁>>代碼示例>>C#>>正文


C# Char.IsAlphanumericAscii方法代碼示例

本文整理匯總了C#中System.Char.IsAlphanumericAscii方法的典型用法代碼示例。如果您正苦於以下問題:C# Char.IsAlphanumericAscii方法的具體用法?C# Char.IsAlphanumericAscii怎麽用?C# Char.IsAlphanumericAscii使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Char的用法示例。


在下文中一共展示了Char.IsAlphanumericAscii方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TextDeclEncoding

        /// <summary>
        /// Gets the encoding specified in the text declaration.
        /// </summary>
        /// <param name="c">The character.</param>
        /// <param name="decl">The current declaration.</param>
        /// <returns>The token.</returns>
        DtdToken TextDeclEncoding(Char c, DtdDeclToken decl)
        {
            if (c == Specification.EQ)
            {
                var q = _stream.Next;

                if (q == Specification.DQ || q == Specification.SQ)
                {
                    _stringBuffer.Clear();
                    c = _stream.Next;

                    if (c.IsLetter())
                    {
                        do
                        {
                            _stringBuffer.Append(c);
                            c = _stream.Next;
                        }
                        while (c.IsAlphanumericAscii() || c == Specification.DOT || c == Specification.UNDERSCORE || c == Specification.MINUS);
                    }

                    if (c == q)
                    {
                        decl.Encoding = _stringBuffer.ToString();
                        return TextDeclAfter(_stream.Next, decl);
                    }
                }
            }

            throw Errors.Xml(ErrorCode.DtdTextDeclInvalid);
        }
開發者ID:fjwuyongzhi,項目名稱:AngleSharp,代碼行數:37,代碼來源:DtdPlainTokenizer.cs

示例2: DeclarationEncodingValue

        /// <summary>
        /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl.
        /// </summary>
        /// <param name="c">The next input character.</param>
        /// <param name="q">The quote character.</param>
        /// <param name="decl">The current declaration token.</param>
        XmlToken DeclarationEncodingValue(Char c, Char q, XmlDeclarationToken decl)
        {
            do
            {
                if (c.IsAlphanumericAscii() || c == Symbols.Dot || c == Symbols.Underscore || c == Symbols.Minus)
                {
                    _stringBuffer.Append(c);
                    c = GetNext();
                }
                else
                    throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition());
            }
            while (c != q);

            decl.Encoding = FlushBuffer();
            c = GetNext();

            if (c.IsSpaceCharacter())
                return DeclarationAfterEncoding(c, decl);

            return DeclarationEnd(c, decl);
        }
開發者ID:fjwuyongzhi,項目名稱:AngleSharp,代碼行數:28,代碼來源:XmlTokenizer.cs

示例3: DeclarationEncodingValue

        /// <summary>
        /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl.
        /// </summary>
        /// <param name="c">The next input character.</param>
        /// <param name="q">The quote character.</param>
        /// <param name="decl">The current declaration token.</param>
        XmlToken DeclarationEncodingValue(Char c, Char q, XmlDeclarationToken decl)
        {
            do
            {
                if (c.IsAlphanumericAscii() || c == Specification.DOT || c == Specification.UNDERSCORE || c == Specification.MINUS)
                {
                    _stringBuffer.Append(c);
                    c = _src.Next;
                }
                else
                    throw Errors.Xml(ErrorCode.XmlDeclarationInvalid);
            }
            while (c != q);

            decl.Encoding = _stringBuffer.ToString();
            c = _src.Next;

            if(c.IsSpaceCharacter())
                return DeclarationAfterEncoding(c, decl);

            return DeclarationEnd(c, decl);
        }
開發者ID:rrsc,項目名稱:AngleSharp,代碼行數:28,代碼來源:XmlTokenizer.cs


注:本文中的System.Char.IsAlphanumericAscii方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。