本文整理汇总了C#中System.Char.IsLetter方法的典型用法代码示例。如果您正苦于以下问题:C# Char.IsLetter方法的具体用法?C# Char.IsLetter怎么用?C# Char.IsLetter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Char
的用法示例。
在下文中一共展示了Char.IsLetter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessingStart
/// <summary>
/// More http://www.w3.org/TR/REC-xml/#sec-pi.
/// </summary>
/// <param name="c">The next input character.</param>
protected XmlToken ProcessingStart(Char c)
{
if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return ProcessingTarget(_src.Next, XmlToken.Processing());
}
else
{
RaiseErrorOccurred(ErrorCode.AmbiguousOpenTag);
throw new ArgumentException("Invalid processing instruction.");
}
}
示例2: 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);
}
示例3: ScriptDataStartDoubleEscape
/// <summary>
/// See 8.2.4.28 Script data double escape start state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken ScriptDataStartDoubleEscape(Char c)
{
if (c.IsSpaceCharacter() || c == Specification.SOLIDUS || c == Specification.GT)
{
_buffer.Append(c);
if (String.Compare(_stringBuffer.ToString(), Tags.SCRIPT, StringComparison.OrdinalIgnoreCase) == 0)
return ScriptDataEscapedDouble(_src.Next);
return ScriptDataEscaped(_src.Next);
}
else if (c.IsLetter())
{
_stringBuffer.Append(c);
_buffer.Append(c);
return ScriptDataStartDoubleEscape(_src.Next);
}
return ScriptDataEscaped(c);
}
示例4: ScriptDataNameEndTag
/// <summary>
/// See 8.2.4.19 Script data end tag name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken ScriptDataNameEndTag(Char c, HtmlTagToken tag)
{
var name = _stringBuffer.ToString().ToLower();
var appropriateEndTag = name == _lastStartTag;
if (appropriateEndTag && c.IsSpaceCharacter())
{
tag.Name = name;
return AttributeBeforeName(_src.Next, tag);
}
else if (appropriateEndTag && c == Specification.SOLIDUS)
{
tag.Name = name;
return TagSelfClosing(_src.Next, tag);
}
else if (appropriateEndTag && c == Specification.GT)
{
tag.Name = name;
return EmitTag(tag);
}
else if (c.IsLetter())
{
_stringBuffer.Append(c);
return ScriptDataNameEndTag(_src.Next, tag);
}
_buffer.Append(Specification.LT).Append(Specification.SOLIDUS);
_buffer.Append(_stringBuffer.ToString());
return ScriptData(c);
}
示例5: ScriptDataEscapedLT
/// <summary>
/// See 8.2.4.25 Script data escaped less-than sign state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken ScriptDataEscapedLT(Char c)
{
if (c == Specification.SOLIDUS)
{
return ScriptDataEndTag(_src.Next);
}
else if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
_buffer.Append(Specification.LT);
_buffer.Append(c);
return ScriptDataStartDoubleEscape(_src.Next);
}
_buffer.Append(Specification.LT);
return ScriptDataEscaped(c);
}
示例6: ScriptDataEscapedEndTag
/// <summary>
/// See 8.2.4.26 Script data escaped end tag open state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken ScriptDataEscapedEndTag(Char c, HtmlTagToken tag)
{
if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return ScriptDataEscapedEndTag(_src.Next, tag);
}
_buffer.Append(Specification.LT).Append(Specification.SOLIDUS);
return ScriptDataEscaped(c);
}
示例7: DeclarationEncodingBeforeValue
/// <summary>
/// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl.
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="decl">The current declaration token.</param>
XmlToken DeclarationEncodingBeforeValue(Char c, XmlDeclarationToken decl)
{
while (c.IsSpaceCharacter())
c = _src.Next;
if (c == Specification.DQ || c == Specification.SQ)
{
var q = c;
_stringBuffer.Clear();
c = _src.Next;
if (c.IsLetter())
return DeclarationEncodingValue(c, q, decl);
}
throw Errors.Xml(ErrorCode.XmlDeclarationInvalid);
}
示例8: ScriptDataEscapedEndTag
/// <summary>
/// See 8.2.4.26 Script data escaped end tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken ScriptDataEscapedEndTag(Char c)
{
var offset = _stringBuffer.Append(Symbols.LessThan).Append(Symbols.Solidus).Length;
if (c.IsLetter())
{
_stringBuffer.Append(c);
return ScriptDataEscapedNameEndTag(NewTagClose(), offset);
}
else
{
return ScriptDataEscaped(c);
}
}
示例9: ScriptDataEscapedNameTag
/// <summary>
/// See 8.2.4.27 Script data escaped end tag name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken ScriptDataEscapedNameTag(Char c, HtmlTagToken tag)
{
var name = _stringBuffer.ToString().ToLower();
var appropriateEndTag = name == _lastStartTag;
if (appropriateEndTag && c.IsSpaceCharacter())
{
tag.Name = name;
return AttributeBeforeName(Next, tag);
}
else if (appropriateEndTag && c == Specification.Solidus)
{
tag.Name = name;
return TagSelfClosing(Next, tag);
}
else if (appropriateEndTag && c == Specification.GreaterThan)
{
tag.Name = name;
return EmitTag(tag);
}
else if (c.IsLetter())
{
_stringBuffer.Append(c);
return ScriptDataEscapedNameTag(Next, tag);
}
_buffer.Append(Specification.LessThan).Append(Specification.Solidus);
_buffer.Append(_stringBuffer.ToString());
return ScriptDataEscaped(c);
}
示例10: ScriptDataEscapedLT
/// <summary>
/// See 8.2.4.25 Script data escaped less-than sign state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken ScriptDataEscapedLT(Char c)
{
if (c == Specification.Solidus)
{
return ScriptDataEndTag(Next);
}
else if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
_buffer.Append(Specification.LessThan);
_buffer.Append(c);
return ScriptDataStartDoubleEscape(Next);
}
_buffer.Append(Specification.LessThan);
return ScriptDataEscaped(c);
}
示例11: ScriptDataEscapedEndTag
/// <summary>
/// See 8.2.4.26 Script data escaped end tag open state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="tag">The current tag token.</param>
/// <returns>The emitted token.</returns>
HtmlToken ScriptDataEscapedEndTag(Char c, HtmlTagToken tag)
{
if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return ScriptDataEscapedEndTag(Next, tag);
}
_buffer.Append(Specification.LessThan).Append(Specification.Solidus);
return ScriptDataEscaped(c);
}
示例12: ScriptDataEndTag
/// <summary>
/// See 8.2.4.18 Script data end tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken ScriptDataEndTag(Char c)
{
if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return ScriptDataNameEndTag(Next, HtmlToken.CloseTag());
}
_buffer.Append(Specification.LessThan).Append(Specification.Solidus);
return ScriptData(c);
}
示例13: ScriptDataEndDoubleEscape
/// <summary>
/// See 8.2.4.33 Script data double escape end state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken ScriptDataEndDoubleEscape(Char c)
{
if (c.IsSpaceCharacter() || c == Specification.Solidus || c == Specification.GreaterThan)
{
_buffer.Append(c);
if (String.Compare(_stringBuffer.ToString(), Tags.Script, StringComparison.OrdinalIgnoreCase) == 0)
return ScriptDataEscaped(Next);
return ScriptDataEscapedDouble(Next);
}
else if (c.IsLetter())
{
_stringBuffer.Append(c);
_buffer.Append(c);
return ScriptDataEndDoubleEscape(Next);
}
return ScriptDataEscapedDouble(c);
}
示例14: TagOpen
/// <summary>
/// More http://www.w3.org/TR/REC-xml/#sec-starttags.
/// </summary>
/// <param name="c">The next input character.</param>
XmlToken TagOpen(Char c)
{
if (c == Specification.EM)
{
return MarkupDeclaration(_src.Next);
}
else if (c == Specification.QM)
{
c = _src.Next;
if (_src.ContinuesWith("xml", false))
{
_src.Advance(2);
return DeclarationStart(_src.Next);
}
return ProcessingStart(c);
}
else if (c == Specification.SOLIDUS)
{
return TagEnd(_src.Next);
}
else if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return TagName(_src.Next, XmlToken.OpenTag());
}
else
{
RaiseErrorOccurred(ErrorCode.AmbiguousOpenTag);
return XmlToken.Character(Specification.LT);
}
}
示例15: TagEnd
/// <summary>
/// More http://www.w3.org/TR/REC-xml/#dt-etag.
/// </summary>
/// <param name="c">The next input character.</param>
XmlToken TagEnd(Char c)
{
if (c.IsLetter())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return TagName(_src.Next, XmlToken.CloseTag());
}
else if (c == Specification.EOF)
{
_src.Back();
RaiseErrorOccurred(ErrorCode.EOF);
return XmlToken.EOF;
}
else
{
RaiseErrorOccurred(ErrorCode.TagClosedWrong);
return Data(_src.Next);
}
}