How can I remove duplicate lines in Visual Studio Code?

前端 未结 8 1249
轻奢々
轻奢々 2020-12-12 09:28

Say you have the following text:

abc
123
abc
456
789
abc
abc

I want to remove all \"abc\" lines and just keep one. I don\'t mind sorting. T

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 09:53

    Try find and replace with a regular expression.

    • Find: ^(.+)((?:\r?\n.*)*)(?:\r?\n\1)$

    • Replace: $1$2

    It is possible to introduce some variance in the first group.

提交回复
热议问题