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

后端 未结 6 878
耶瑟儿~
耶瑟儿~ 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:37

    use Environment.NewLine after each line or where you want new line

    eg:-

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

提交回复
热议问题