本文整理汇总了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);
}