Answer the question
In order to leave comments, you need to log in
How to remove extra spaces without string concatenation?
Hello!
I'm trying to write a regular expression for Notepad++ to clean the text from extra spaces.
I found such an option on the Internet. \s{2,}
It cleans spaces, but also combines all lines into one, how to avoid this?
Those. yes i have 2 lines
Стол 180 * 90 * 75 1 шт
Стул с подлокотниками 60 * 60 * 85 6 шт
Стол 180 * 90 * 75 1 шт Стул с подлокотниками 60 * 60 * 85 6 шт
Стол 180 * 90 * 75 1 шт
Стул с подлокотниками 60 * 60 * 85 6 шт
Answer the question
In order to leave comments, you need to log in
\s
is any whitespace character, including the newline character.
It is enough to replace it with "" (space), and then only spaces will be replaced.
You can also specify not any whitespace character in the form \s
, but a class of specific characters in square brackets. For example, spaces + tab characters. It will turn out like this:
[ \t]{2,}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question