本文整理汇总了C#中StringBuilder.AppendWrappedLine方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.AppendWrappedLine方法的具体用法?C# StringBuilder.AppendWrappedLine怎么用?C# StringBuilder.AppendWrappedLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder.AppendWrappedLine方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendWrappedLineIgnoresContentsOfBuilder
public void AppendWrappedLineIgnoresContentsOfBuilder()
{
var builder = new StringBuilder();
builder.Append("PREFIX");
builder.AppendWrappedLine("hello", 3);
builder.ToString().Should().Be("PREFIXhel\r\nlo\r\n");
}
示例2: AppendWrappedLineThrowsOnZeroWidth
public void AppendWrappedLineThrowsOnZeroWidth()
{
var builder = new StringBuilder();
Action append = () => builder.AppendWrappedLine("text", 0);
append.ShouldThrow<ArgumentOutOfRangeException>();
}
示例3: AppendWrappedLineIndentsAroundEmbeddedNewLines
public void AppendWrappedLineIndentsAroundEmbeddedNewLines()
{
var builder = new StringBuilder();
builder.AppendWrappedLine("hello\nworld", 80, 4);
builder.ToString().Should().Be(" hello\r\n world\r\n");
}
示例4: AppendWrappedLineWithMultipleTerminatingNewLines
public void AppendWrappedLineWithMultipleTerminatingNewLines()
{
var builder = new StringBuilder();
builder.AppendWrappedLine("hello\n\n\n", 80);
builder.ToString().Should().Be("hello\r\n\r\n\r\n\r\n");
}
示例5: AppendWrappedLineWithIndent
public void AppendWrappedLineWithIndent()
{
var builder = new StringBuilder();
builder.AppendWrappedLine("hello", 3, 2);
builder.ToString().Should().Be(" h\r\n e\r\n l\r\n l\r\n o\r\n");
}
示例6: AppendWrappedLineNeedsToWrap
public void AppendWrappedLineNeedsToWrap()
{
var builder = new StringBuilder();
builder.AppendWrappedLine("hello", 3);
builder.ToString().Should().Be("hel\r\nlo\r\n");
}
示例7: AppendWrappedLineShortText
public void AppendWrappedLineShortText()
{
var builder = new StringBuilder();
builder.AppendWrappedLine("hello", 80);
builder.ToString().Should().Be("hello\r\n");
}