Remove/Add Line Breaks after Specific String using Sublime Text

后端 未结 4 667
一生所求
一生所求 2021-01-29 17:54

Using Sublime Text 2 - Is it possible to insert a line break/text return after a specific String in a text file e.g. by using the FindReplace

4条回答
  •  死守一世寂寞
    2021-01-29 18:31

    Using the Find - Replace tool, this can be accomplished in two different ways:

    1. Click in the Replace field and press Ctrl + Enter to insert a newline (the field should resize but it doesn't, so it is hard to see the newline inserted).

    2. Inside the Find - Replace tool, activate the S&R regex mode (first icon on the left .*, keyboard shortcut is Alt + Ctrl/Cmd + R to activate/deactivate it).

    3. Type \n in the Replace field wherever you want to insert a newline.

    Both solutions also work if you want to find newlines, just do it in the Find field.

提交回复
热议问题