how to del the Invisible space in the text (or in the variables)?

coolbb

Client
Регистрация
06.09.2013
Сообщения
95
Благодарностей
0
Баллы
6
i want copy the text (no space in it )to the cmd for run, but there is a visible space after it paste to the cmd widow , how to sovle it??

even i put it to the variables then run the program, the space still invisible in the variable but visible in the program window, how to del the space before run??
 

Вложения

Последнее редактирование:

Katana

Client
Регистрация
28.03.2021
Сообщения
81
Благодарностей
7
Баллы
8
Transform your text in "Word list" and "trim" (they are in "text processing")
 

coolbb

Client
Регистрация
06.09.2013
Сообщения
95
Благодарностей
0
Баллы
6
i check , it cant solue the problem! the trim in the text processing only can trim "beging and end", but the space character in the middle of the text, please check, and help me solue the problem
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 233
Благодарностей
5 846
Баллы
113
Text processing>Replace -{-String.Space-} with nothing
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
You can also create a loop and while your string have " " you can replace it for " ".
C# can be your best friend.
 

coolbb

Client
Регистрация
06.09.2013
Сообщения
95
Благодарностей
0
Баллы
6

coolbb

Client
Регистрация
06.09.2013
Сообщения
95
Благодарностей
0
Баллы
6

coolbb

Client
Регистрация
06.09.2013
Сообщения
95
Благодарностей
0
Баллы
6

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
Код:
string s = project.Variables["yourvar"].Value;
bool clearspace = true;

while (true){
    if (s.Contains("  ")){
        s = s.Reaplce("  "," ");

    }

    else{
       clearspace = false;
    }
}

project.Variables["yourvar"].Value = s.Trim();
 

coolbb

Client
Регистрация
06.09.2013
Сообщения
95
Благодарностей
0
Баллы
6

Вложения

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)