Skip to content

Command for adding a space to the beginning of each line of the Clipboard #2571

Closed Answered by hluk
francwalter asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, there are spaces also on empty lines after the replacements.

Maybe it is best to avoid regular expressions in this case and use something like:

text.split("\n").map((line) => line ? ` ${line}` : line).join("\n")

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@francwalter
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hluk
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@hluk
Comment options

Answer selected by francwalter
@francwalter
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants