How do I replace a newline in Atom?

前端 未结 5 1906
滥情空心
滥情空心 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:13

    The purists will probably not like my solution, but you can also transform the find and replace inputs into a multiline text box by copying content with several line breaks and pasting it into the find/replace inputs. It will work with or without using regex.

    For example, you can copy this 3 lines and paste them into both find and replace inputs:

    line 1
    line 2
    line 3
    

    Now that your inputs have the number of lines that you need, you can modify them as you want (and add regex if necessary).

提交回复
热议问题