找到你要的答案

Q:Put a semi-colon (or someonething else) in front of multiple lines in Notepad++

Q:把一个分号(或其他someonething)在记事本+ +多线前

Say I've the following lines in Notepad++:

1234
1234
1234

Suppose I want to put a semicolon in front of every line to get something like:

; 1234 
; 1234 
; 1234

, i.e. indent by a space and write a semi-colon.

I already know how to indent multiple lines with TAB, but this is causing me trouble. Any suggestions ?

说我有以下几行在记事本+:

1234
1234
1234

假设我想把分号在每一行的前面得到的东西一样:

; 1234 
; 1234 
; 1234

,即缩进的空间写分号。

我已经知道如何缩进多行标签,但这是给我添麻烦。有什么建议吗?

answer1: 回答1:

Have a try with:

Click on Ctrl+H

Find what: ^
Replace with: ; (semicolon and space)

Make sure that Regular expression is checked.
Then click on Replace all

You could also do:

Press Alt key and move the mouse from first to last line before the first character (mode column) then enter the characters you want; they will be inserted at the beginig of all selected lines.

尝试一下:

点击Ctrl + H

Find what: ^
Replace with: ; (semicolon and space)

Make sure that Regular expression is checked.
Then click on Replace all

你也可以做:

按ALT键并移动鼠标从第一个到最后一行的第一个字符之前(模式列)然后输入你想要的文字;他们将被插入在所有选定的行的beginig。

answer2: 回答2:

Notepad++ has a column editing mode, also known as rectangular selection. Hold down the ALT key then drag (with the left mouse button pressed) over a block of text. That selects a rectangular area of the text. With a rectangle selected, typed characters will be entered on every line of the rectangle.

With care one can select a zero-width rectangle at the start of the lines of text. So, for the case in this question, select a zero-width rectangle at the start of the relevant lines, then type the semi-colon and space, or the other characters, that are wanted.

记事本有一个栏目编辑模式,也称矩形选择。按住Alt键,然后拖动(按住鼠标左键,在文本块)。选择文本的矩形区域的。与矩形选择,键入字符将被输入的每一行的矩形。

谨慎地在文本行的开始处选择一零个宽度矩形。因此,对于这个问题的情况下,选择一零宽度矩形在开始的相关行,然后键入半冒号和空格,或其他字符,被通缉。

windows  notepad++