当前位置: 首页>>代码示例>>C#>>正文


C# Match.GetLeftSubstring方法代码示例

本文整理汇总了C#中System.Text.RegularExpressions.Match.GetLeftSubstring方法的典型用法代码示例。如果您正苦于以下问题:C# Match.GetLeftSubstring方法的具体用法?C# Match.GetLeftSubstring怎么用?C# Match.GetLeftSubstring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Text.RegularExpressions.Match的用法示例。


在下文中一共展示了Match.GetLeftSubstring方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReplacementImplRTL

        private void ReplacementImplRTL(List<string> al, Match match)
        {
            for (int i = this._rules.Count - 1; i >= 0; i--)
            {
                int num2 = this._rules[i];
                if (num2 >= 0)
                {
                    al.Add(this._strings[num2]);
                }
                else if (num2 < -4)
                {
                    al.Add(match.GroupToStringImpl(-5 - num2));
                }
                else
                {
                    switch ((-5 - num2))
                    {
                        case -4:
                            al.Add(match.GetOriginalString());
                            break;

                        case -3:
                            al.Add(match.LastGroupToStringImpl());
                            break;

                        case -2:
                            al.Add(match.GetRightSubstring());
                            break;

                        case -1:
                            al.Add(match.GetLeftSubstring());
                            break;
                    }
                }
            }
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:36,代码来源:RegexReplacement.cs

示例2: ReplacementImpl

 /// <summary>
 /// Given a Match, emits into the StringBuilder the evaluated
 /// substitution pattern.
 /// </summary>
 private void ReplacementImpl(StringBuilder sb, Match match)
 {
     for (int i = 0; i < _rules.Count; i++)
     {
         int r = _rules[i];
         if (r >= 0)   // string lookup
             sb.Append(_strings[r]);
         else if (r < -Specials) // group lookup
             sb.Append(match.GroupToStringImpl(-Specials - 1 - r));
         else
         {
             switch (-Specials - 1 - r)
             { // special insertion patterns
                 case LeftPortion:
                     sb.Append(match.GetLeftSubstring());
                     break;
                 case RightPortion:
                     sb.Append(match.GetRightSubstring());
                     break;
                 case LastGroup:
                     sb.Append(match.LastGroupToStringImpl());
                     break;
                 case WholeString:
                     sb.Append(match.GetOriginalString());
                     break;
             }
         }
     }
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:33,代码来源:RegexReplacement.cs

示例3: ReplacementImpl

        private void ReplacementImpl(StringBuilder sb, Match match)
        {
            for (int i = 0; i < this._rules.Count; i++)
            {
                int num2 = this._rules[i];
                if (num2 >= 0)
                {
                    sb.Append(this._strings[num2]);
                }
                else if (num2 < -4)
                {
                    sb.Append(match.GroupToStringImpl(-5 - num2));
                }
                else
                {
                    switch ((-5 - num2))
                    {
                        case -4:
                            sb.Append(match.GetOriginalString());
                            break;

                        case -3:
                            sb.Append(match.LastGroupToStringImpl());
                            break;

                        case -2:
                            sb.Append(match.GetRightSubstring());
                            break;

                        case -1:
                            sb.Append(match.GetLeftSubstring());
                            break;
                    }
                }
            }
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:36,代码来源:RegexReplacement.cs

示例4: ReplacementImplRTL

 /// <summary>
 /// Given a Match, emits into the List<String> the evaluated
 /// Right-to-Left substitution pattern.
 /// </summary>
 private void ReplacementImplRTL(List<String> al, Match match)
 {
     for (int i = _rules.Count - 1; i >= 0; i--)
     {
         int r = _rules[i];
         if (r >= 0)  // string lookup
             al.Add(_strings[r]);
         else if (r < -Specials) // group lookup
             al.Add(match.GroupToStringImpl(-Specials - 1 - r));
         else
         {
             switch (-Specials - 1 - r)
             { // special insertion patterns
                 case LeftPortion:
                     al.Add(match.GetLeftSubstring());
                     break;
                 case RightPortion:
                     al.Add(match.GetRightSubstring());
                     break;
                 case LastGroup:
                     al.Add(match.LastGroupToStringImpl());
                     break;
                 case WholeString:
                     al.Add(match.GetOriginalString());
                     break;
             }
         }
     }
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:33,代码来源:RegexReplacement.cs


注:本文中的System.Text.RegularExpressions.Match.GetLeftSubstring方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。