.Replace(Environment.NewLine, “
”) works on localhost but not when I upload my website to host

后端 未结 4 722
灰色年华
灰色年华 2021-02-12 20:14

I have no idea why is that. Here is my code and it works perfectly when I try it on localhost but when I upload my website my text has no
\'s. Why this

4条回答
  •  名媛妹妹
    2021-02-12 20:58

    I believe this answer is best: https://stackoverflow.com/a/8196219/550975

    string result = Regex.Replace(input, @"\r\n?|\n", "
    ");

提交回复
热议问题