本文整理汇总了C#中System.Text.StringBuilder.Reverse方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.Reverse方法的具体用法?C# StringBuilder.Reverse怎么用?C# StringBuilder.Reverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.Reverse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestReverse
public virtual void TestReverse()
{
var sb = new StringBuilder("foo 𝌆 bar𫀁mañana");
sb.Reverse();
Assert.AreEqual("anañam𫀁rab 𝌆 oof", sb.ToString());
}
示例2: GetPath
/// <summary>
/// Gets the full path to this document.
/// </summary>
///
/// <returns>
/// The path.
/// </returns>
protected virtual string GetPath()
{
DomObject curNode = this;
StringBuilder sb = new StringBuilder();
while (curNode != null)
{
#if CACHE_PATH
if (curNode._Path != null)
{
return curNode._Path + sb.Reverse().ToString();
}
#endif
sb.Append(curNode.PathID);
curNode = curNode._ParentNode;
}
return sb.Reverse().ToString();
}
示例3: getKey
/// <summary>
/// Returns the key that indexes the node argument.
/// </summary>
/// <param name="node">
/// The node whose index is to be calculated. </param>
/// <returns> The <code>String</code> that indexes the node argument. </returns>
protected internal virtual string getKey(TSTNode node)
{
StringBuilder getKeyBuffer = new StringBuilder();
getKeyBuffer.Length = 0;
getKeyBuffer.Append("" + node.splitchar);
TSTNode currentNode;
TSTNode lastNode;
currentNode = node.relatives[TSTNode.PARENT];
lastNode = node;
while (currentNode != null)
{
if (currentNode.relatives[TSTNode.EQKID] == lastNode)
{
getKeyBuffer.Append("" + currentNode.splitchar);
}
lastNode = currentNode;
currentNode = currentNode.relatives[TSTNode.PARENT];
}
getKeyBuffer.Reverse();
return getKeyBuffer.ToString();
}