Regex (C#): Replace \n with \r\n

前端 未结 7 1813
陌清茗
陌清茗 2020-12-13 18:11

How can I replace lone instances of \\n with \\r\\n (LF alone with CRLF) using a regular expression in C#?

Sorry if it\'s a stupid question, I\'m new to Regex.

7条回答
  •  忘掉有多难
    2020-12-13 18:28

    Try this: Replace(Char.ConvertFromUtf32(13), Char.ConvertFromUtf32(10) + Char.ConvertFromUtf32(13))

提交回复
热议问题