Remove single line breaks, keep “empty” lines

前端 未结 4 582
孤街浪徒
孤街浪徒 2020-12-19 04:06

Say I have text like the following text selected with the cursor:

This is a test. 
This 
is a test.

This is a test. 
This is a 
test.

I wo

4条回答
  •  温柔的废话
    2020-12-19 05:01

    #SingleInstance force
    
    #v::
        Send ^c
        ClipWait
        ClipSaved = %clipboard%
    
        Loop
        {
            StringReplace, ClipSaved, ClipSaved, `r`n`r`n, `r`n, UseErrorLevel
            if ErrorLevel = 0  ; No more replacements needed.
                break
        }
        Clipboard := ClipSaved
        return
    

提交回复
热议问题