本文整理汇总了C#中System.Char.ToLower方法的典型用法代码示例。如果您正苦于以下问题:C# Char.ToLower方法的具体用法?C# Char.ToLower怎么用?C# Char.ToLower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Char
的用法示例。
在下文中一共展示了Char.ToLower方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
var appropriateEndTag = name == lastStartTag;
if (appropriateEndTag && Specification.IsSpaceCharacter(c))
{
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 (Specification.IsUppercaseAscii(c))
{
stringBuffer.Append(c.ToLower());
return ScriptDataNameEndTag(src.Next, tag);
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Append(c);
return ScriptDataNameEndTag(src.Next, tag);
}
stringBuffer.Insert(0, Specification.LT).Insert(1, Specification.SOLIDUS);
EnqueueToken(HtmlToken.Characters(stringBuffer.ToString()));
return ScriptData(c);
}
示例2: 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 (Specification.IsSpaceCharacter(c))
{
if (stringBuffer.ToString() == "script")
return ScriptDataEscapedDouble(src.Next);
EnqueueToken(HtmlToken.Character(c));
return ScriptDataEscaped(src.Next);
}
else if (Specification.IsUppercaseAscii(c))
{
stringBuffer.Append(c.ToLower());
EnqueueToken(HtmlToken.Character(c));
return ScriptDataStartDoubleEscape(src.Next);
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Append(c);
EnqueueToken(HtmlToken.Character(c));
return ScriptDataStartDoubleEscape(src.Next);
}
return ScriptDataEscaped(c);
}
示例3: 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 (Specification.IsUppercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c.ToLower());
return ScriptDataEscapedEndTag(src.Next, tag);
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c);
return ScriptDataEscapedEndTag(src.Next, tag);
}
EnqueueToken(HtmlToken.Character(Specification.LT));
EnqueueToken(HtmlToken.Character(Specification.SOLIDUS));
return ScriptDataEscaped(c);
}
示例4: 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 (Specification.IsUppercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c.ToLower());
EnqueueToken(HtmlToken.Character(Specification.LT));
EnqueueToken(HtmlToken.Character(c));
return ScriptDataStartDoubleEscape(src.Next);
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Clear();
stringBuffer.Append(c);
EnqueueToken(HtmlToken.Character(Specification.LT));
EnqueueToken(HtmlToken.Character(c));
return ScriptDataStartDoubleEscape(src.Next);
}
EnqueueToken(HtmlToken.Character(Specification.LT));
return ScriptDataEscaped(c);
}
示例5: 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.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(c.ToLower());
return ScriptDataEscapedEndTag(_src.Next, tag);
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(c);
return ScriptDataEscapedEndTag(_src.Next, tag);
}
_buffer.Append(Specification.LT).Append(Specification.SOLIDUS);
return ScriptDataEscaped(c);
}
示例6: AttributeBeforeName
/// <summary>
/// See 8.2.4.34 Before attribute 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 AttributeBeforeName(Char c, HtmlTagToken tag)
{
while (Specification.IsSpaceCharacter(c))
c = src.Next;
if (c == Specification.SOLIDUS)
{
return TagSelfClosing(src.Next, tag);
}
else if (c == Specification.GT)
{
return EmitTag(tag);
}
else if (Specification.IsUppercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c.ToLower());
return AttributeName(src.Next, tag);
}
else if (c == Specification.NULL)
{
RaiseErrorOccurred(ErrorCode.NULL);
stringBuffer.Clear();
stringBuffer.Append(Specification.REPLACEMENT);
return AttributeName(src.Next, tag);
}
else if (c == Specification.SQ || c == Specification.DQ || c == Specification.EQ || c == Specification.LT)
{
RaiseErrorOccurred(ErrorCode.AttributeNameInvalid);
stringBuffer.Clear();
stringBuffer.Append(c);
return AttributeName(src.Next, tag);
}
else if (c == Specification.EOF)
{
return HtmlToken.EOF;
}
else
{
stringBuffer.Clear();
stringBuffer.Append(c);
return AttributeName(src.Next, tag);
}
}
示例7: RCDataEndTag
/// <summary>
/// See 8.2.4.12 RCDATA end tag open state
/// </summary>
/// <param name="c">The next input character.</param>
/// <returns>The emitted token.</returns>
HtmlToken RCDataEndTag(Char c)
{
if (Specification.IsUppercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c.ToLower());
return RCDataNameEndTag(src.Next, HtmlToken.CloseTag());
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c);
return RCDataNameEndTag(src.Next, HtmlToken.CloseTag());
}
else
{
src.Back();
return HtmlToken.Characters(Specification.LT, Specification.SOLIDUS);
}
}
示例8: TagOpen
/// <summary>
/// See 8.2.4.8 Tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken TagOpen(Char c)
{
if (c == Specification.EM)
{
return MarkupDeclaration(src.Next);
}
else if (c == Specification.SOLIDUS)
{
return TagEnd(src.Next);
}
else if (Specification.IsUppercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c.ToLower());
return TagName(src.Next, HtmlToken.OpenTag());
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c);
return TagName(src.Next, HtmlToken.OpenTag());
}
else if (c == Specification.QM)
{
RaiseErrorOccurred(ErrorCode.BogusComment);
return BogusComment(c);
}
else
{
model = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.AmbiguousOpenTag);
return HtmlToken.Character(Specification.LT);
}
}
示例9: DoctypeName
/// <summary>
/// See 8.2.4.54 DOCTYPE name state
/// </summary>
/// <param name="c">The next input character.</param>
/// <param name="doctype">The current doctype token.</param>
/// <returns>The emitted token.</returns>
HtmlToken DoctypeName(Char c, HtmlDoctypeToken doctype)
{
while (true)
{
if (Specification.IsSpaceCharacter(c))
{
doctype.Name = stringBuffer.ToString();
return DoctypeNameAfter(src.Next, doctype);
}
else if (c == Specification.GT)
{
model = HtmlParseMode.PCData;
doctype.Name = stringBuffer.ToString();
return doctype;
}
else if (Specification.IsUppercaseAscii(c))
stringBuffer.Append(c.ToLower());
else if (c == Specification.NULL)
{
RaiseErrorOccurred(ErrorCode.NULL);
stringBuffer.Append(Specification.REPLACEMENT);
}
else if (c == Specification.EOF)
{
RaiseErrorOccurred(ErrorCode.EOF);
src.Back();
doctype.IsQuirksForced = true;
doctype.Name = stringBuffer.ToString();
return doctype;
}
else
stringBuffer.Append(c);
c = src.Next;
}
}
示例10: DoctypeNameBefore
/// <summary>
/// See 8.2.4.53 Before DOCTYPE name state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken DoctypeNameBefore(Char c)
{
while (Specification.IsSpaceCharacter(c))
c = src.Next;
if (Specification.IsUppercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c.ToLower());
return DoctypeName(src.Next, HtmlToken.Doctype(false));
}
else if (c == Specification.NULL)
{
RaiseErrorOccurred(ErrorCode.NULL);
stringBuffer.Clear();
stringBuffer.Append(Specification.REPLACEMENT);
return DoctypeName(src.Next, HtmlToken.Doctype(false));
}
else if (c == Specification.GT)
{
model = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.TagClosedWrong);
return HtmlToken.Doctype(true);
}
else if (c == Specification.EOF)
{
RaiseErrorOccurred(ErrorCode.EOF);
src.Back();
return HtmlToken.Doctype(true);
}
stringBuffer.Clear();
stringBuffer.Append(c);
return DoctypeName(src.Next, HtmlToken.Doctype(false));
}
示例11: 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 (_stringBuffer.ToString() == "script")
return ScriptDataEscapedDouble(_src.Next);
return ScriptDataEscaped(_src.Next);
}
else if (c.IsUppercaseAscii())
{
_stringBuffer.Append(c.ToLower());
_buffer.Append(c);
return ScriptDataStartDoubleEscape(_src.Next);
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Append(c);
_buffer.Append(c);
return ScriptDataStartDoubleEscape(_src.Next);
}
return ScriptDataEscaped(c);
}
示例12: 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();
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.IsUppercaseAscii())
{
_stringBuffer.Append(c.ToLower());
return ScriptDataNameEndTag(_src.Next, tag);
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Append(c);
return ScriptDataNameEndTag(_src.Next, tag);
}
_buffer.Append(Specification.LT).Append(Specification.SOLIDUS);
_buffer.Append(_stringBuffer.ToString());
return ScriptData(c);
}
示例13: 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.IsUppercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Append(c.ToLower());
_buffer.Append(Specification.LT);
_buffer.Append(c);
return ScriptDataStartDoubleEscape(_src.Next);
}
else if (c.IsLowercaseAscii())
{
_stringBuffer.Clear();
_stringBuffer.Clear();
_stringBuffer.Append(c);
_buffer.Append(Specification.LT);
_buffer.Append(c);
return ScriptDataStartDoubleEscape(_src.Next);
}
_buffer.Append(Specification.LT);
return ScriptDataEscaped(c);
}
示例14: TagEnd
/// <summary>
/// See 8.2.4.9 End tag open state
/// </summary>
/// <param name="c">The next input character.</param>
HtmlToken TagEnd(Char c)
{
if (Specification.IsUppercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c.ToLower());
return TagName(src.Next, HtmlToken.CloseTag());
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Clear();
stringBuffer.Append(c);
return TagName(src.Next, HtmlToken.CloseTag());
}
else if (c == Specification.GT)
{
model = HtmlParseMode.PCData;
RaiseErrorOccurred(ErrorCode.TagClosedWrong);
return Data(src.Next);
}
else if (c == Specification.EOF)
{
src.Back();
RaiseErrorOccurred(ErrorCode.EOF);
return HtmlToken.Characters(Specification.LT, Specification.SOLIDUS);
}
else
{
RaiseErrorOccurred(ErrorCode.BogusComment);
return BogusComment(c);
}
}
示例15: 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 (Specification.IsSpaceCharacter(c) || c == Specification.SOLIDUS || c == Specification.GT)
{
if (stringBuffer.ToString().Equals("script", StringComparison.OrdinalIgnoreCase))
return ScriptDataEscaped(src.Next);
EnqueueToken(HtmlToken.Character(c));
return ScriptDataEscapedDouble(src.Next);
}
else if (Specification.IsUppercaseAscii(c))
{
stringBuffer.Append(c.ToLower());
EnqueueToken(HtmlToken.Character(c));
return ScriptDataEndDoubleEscape(src.Next);
}
else if (Specification.IsLowercaseAscii(c))
{
stringBuffer.Append(c);
EnqueueToken(HtmlToken.Character(c));
return ScriptDataEndDoubleEscape(src.Next);
}
return ScriptDataEscapedDouble(c);
}