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


C# Char.ToLower方法代碼示例

本文整理匯總了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);
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:41,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:29,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:25,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:31,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:Rajbandi,項目名稱:AngleSharp,代碼行數:24,代碼來源:HtmlTokenizer.cs

示例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);
            }
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:50,代碼來源:HtmlTokenizer.cs

示例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);
     }
 }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:25,代碼來源:HtmlTokenizer.cs

示例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);
     }
 }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:38,代碼來源:HtmlTokenizer.cs

示例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;
            }
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:42,代碼來源:HtmlTokenizer.cs

示例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));
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:39,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:Rajbandi,項目名稱:AngleSharp,代碼行數:30,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:Rajbandi,項目名稱:AngleSharp,代碼行數:41,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:Rajbandi,項目名稱:AngleSharp,代碼行數:31,代碼來源:HtmlTokenizer.cs

示例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);
     }
 }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:36,代碼來源:HtmlTokenizer.cs

示例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);
        }
開發者ID:ranjancse26,項目名稱:AngleSharp,代碼行數:29,代碼來源:HtmlTokenizer.cs


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