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