Fechar (X)
|
Às vezes, como pode ser o caso do código ou de uma consulta SQL, você pode querer preservar linhas em branco em sua string ou código Stringbuilder para fins de legibilidade:
|
// Sample code follows
for(int i=0; i<5; i++)
{
Console.WriteLine("Current Count: " + i.ToString());
}
Console.WriteLine("Final Count: " + i.ToString());
|
Checking this box will preserve your blank lines in the output:
|
StringBuilder sb = new StringBuilder();
sb.Append("// Sample code follows");
sb.Append("");
sb.Append("for(int i=0; i<5; i++) ");
sb.Append(" {");
sb.Append(" Console.WriteLine(\"Current Count: \" + i.ToString());");
sb.Append(" }");
sb.Append("");
sb.Append("Console.WriteLine(\"Final Count: \" + i.ToString());");
|
Or, leave this box unchecked and blank lines in the input will not be included in the output:
|
StringBuilder sb = new StringBuilder();
sb.Append("// Sample code follows");
sb.Append("for(int i=0; i<5; i++) ");
sb.Append(" {");
sb.Append(" Console.WriteLine(\"Current Count: \" + i.ToString());");
sb.Append(" }");
sb.Append("Console.WriteLine(\"Final Count: \" + i.ToString());");
|
Observe que, se você selecionar a opção para preservar linhas em branco E qualquer uma das opções que incluam caracteres adicionais no final de cada linha, a saÃda também anexará esses caracteres à s suas linhas em branco.
|
Fechar (X)
|