本文整理匯總了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);
}
示例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);
}
示例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);
}