How do I replace a newline in Atom?

前端 未结 5 1971
滥情空心
滥情空心 2021-01-31 03:07

In Atom, If I activate regex mode on the search-and-replace tool, it can find newlines as \\n, but when I try to replace them, they\'re still there.

Is th

5条回答
  •  渐次进展
    2021-01-31 03:18

    DELETE INVISIBLE LINE BREAKS IN CODE WITH ATOM (using the "Find in buffer" function)

    (- open your code-file with the Atom-Editor)

    • Hit cmd(mac)/ctrl(win) + f on your keyboard for activating the Find in buffer function (a little window appears at the bottom atom-screen edge).

    • Mark your Code in which you want to delete the invisible Line breaks.

    • Click on the Markup-Mode Button and after that on the Regex-Mode (.*) Button and type into the first field: \n

    • After that click replace all.

    [And Atom will delete all the invisible line breaks indicated by \n (if you use LF-Mode right bottom corner, for CRLF-Mode (very common on windows machines as default) use \r\n) by replacing them with nothing.]

    Hope that helps.

    Synaikido

提交回复
热议问题