I am trying to create multi-line string from string array like
@"A minErr message has two parts:
the message itself and the url that contains the encoded message.
The message's parameters can contain other error messages which also include error urls.";
and I have string array of these line
string [] miltilines={"A minErr message has two parts:","the message itself and the url that contains the encoded message.","The message's parameters can contain other error messages which also include error urls."}
I have tried multiple approaches to get multiline string object but ended with \r\n in string object
1: String.Join(Environment.NewLine, miltilines)
2:
string multiline = @" ";
foreach (var item in miltilines)
{
multiline += @"" + item.Trim() + " ";
}
3:
StringBuilder stringBuilder = new StringBuilder();
foreach (var item in miltilines)
{
stringBuilder.AppendLine(item );
}
Is there any way to get multi line string object from string array
but ended with \r\n in string objectthat's how a line break is represented in visual studio debug windows. If you write that string to a file and open in a text editor, you will see the line break.\r\n.\r\nin it. You've just used the@to hide the characters and show the formatted string in the editor. Set a breakpoint after that line and look at the string in the debugger.