How to add a word to each line of a list?

zmike

Client
Регистрация
24.10.2019
Сообщения
133
Благодарностей
8
Баллы
18
I have a list and I wish to add a word to the end of each line.
How to do that?

I tried to research in the forum before asking.

List example:
AA
BB
CC

Word to add
<word>

Final result:
AA<word>
BB<word>
CC<word>
 

Aronax

Client
Регистрация
29.01.2015
Сообщения
205
Благодарностей
59
Баллы
28
You should create a different new list (List 2). Take each line from the initial list (List 1). Place each line in a variable. Let's say you call it {-Variable.lineContent-} Create a new variable (eg: {-Variable.newLineContent-}) in which you combine {-Variable.lineContent-} and <word>
75358

Put {-Variable.newLineContent-} in List 2

Note: I edited this post because the first solution I came up with was wrong
 
Последнее редактирование:

zmike

Client
Регистрация
24.10.2019
Сообщения
133
Благодарностей
8
Баллы
18
Thanks for the reply.

I think there should a snippet which can do it.

The closet I can find is to an example here
c# snippet on Github

But it deletes a line that contains a text.

I tried to modify it, so it does not delete a line but add a line using

ProxyList.Add(proxy);

But it is not working.
 

Aronax

Client
Регистрация
29.01.2015
Сообщения
205
Благодарностей
59
Баллы
28
[QUOTE = "zmike, post: 609293, member: 42576"]
Thanks for the reply.

I think there should a snippet which can do it.

The closet I can find is to an example here
c # snippet on Github

But it deletes a line that contains a text.

I tried to modify it, so it does not delete a line but add a line using

ProxyList.Add (proxy);

But it is not working.
[/ QUOTE]
My first solution was wrong ... please check my edited post
I'm sure there are other C# solutions for this, but it can be easily done with zenno standard functionality
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
I would make it this way:
1) Take first line from list with deletion.
2) Add word to taken line
3) Add line with word to the end of the list
4) repeat this in a loop n times, where n is the initial number of lines in the list.
 

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