Why does StringBuilder.AppendLine not add a new line with some strings?

后端 未结 6 892
耶瑟儿~
耶瑟儿~ 2021-01-03 17:43

I\'m trying to use stringbuilder to create a body of string to be used in a text (not HTML) email. However some lines (where i include dynamic data, a new line is not added,

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-03 18:24

    use Environment.NewLine

    sbUser.AppendLine("Please find below confirmation of your registration details. If any of these details are incorrect, please email someone@somewhere.com");
    sbUser.AppendLine(Environment.NewLine);
    sbUser.AppendLine("Selected event : " + ContentPage.FetchByID(int.Parse(ddlEvent.SelectedValue)).PageTitle); 
    sbUser.AppendLine("Date of event : " + thisEvent.EventStartDate.ToString("dd MMM yyyy"));
    sbUser.AppendLine("==============================================================");
    sbUser.AppendLine(Environment.NewLine);
    

提交回复
热议问题