.NET StringBuilder preappend a line

前端 未结 2 1354
情歌与酒
情歌与酒 2021-02-18 14:41

I know that the System.Text.StringBuilder in .NET has an AppendLine() method, however, I need to pre-append a line to the beginning of a StringBu

2条回答
  •  长发绾君心
    2021-02-18 15:05

    You can use AppendFormat to add a new line where ever you like.

    Dim sb As New StringBuilder()
    sb.AppendFormat("{0}Foo Bacon", Environment.NewLine)
    

提交回复
热议问题