当我键入if()然后{它看起来像这个
if() {空格,没有
我想要的右大括号,if()然后我键入然后{看起来像这样没有空格和右大括号
if(){
//code
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试将String Builder保存到文件中,但它不会创建新行.输出应该是这样的

class Program
{
static public void justify(List<string> words, int width)
{
//some code to build the arrays
int ii = 0, jj;
StringBuilder builder = new StringBuilder();
do
{
jj = result[ii];
for(int k = ii; k < jj; k++)
{
builder.Append(words[k] + " ");
}
builder.Append("\n");
ii = jj;
}
while(jj < words.Count);
Console.WriteLine(builder.ToString());
StreamWriter file = new StreamWriter("output.txt");
file.Write(builder.ToString());
file.Close();
}
static void Main(string[] args)
{
string file_extention, file1;
file1 = Console.ReadLine();
file_extention = "C:\\Users\\sayed\\Desktop\\" …Run Code Online (Sandbox Code Playgroud)