get line number of a word in a list

Saeedgh837

Client
Регистрация
09.04.2019
Сообщения
56
Благодарностей
1
Баллы
8
hi guys

I have a list like this below:

book
pencil
door
window


any way to find the number of one of them with list processing?
I need to search for "book"
answer must be: "0" (Which is its Line number in the list)
 

Alexmd

Client
Регистрация
10.12.2018
Сообщения
1 021
Благодарностей
1 385
Баллы
113
Just put this code into the C# block & replace values "yourListName","book" with your's
C#:
return project.Lists["yourListName"].IndexOf("book");
If there is no such entry in list, you'll got -1
 

Saeedgh837

Client
Регистрация
09.04.2019
Сообщения
56
Благодарностей
1
Баллы
8
thank you alex
 

Saeedgh837

Client
Регистрация
09.04.2019
Сообщения
56
Благодарностей
1
Баллы
8
Just put this code into the C# block & replace values "yourListName","book" with your's
C#:
return project.Lists["yourListName"].IndexOf("book");
If there is no such entry in list, you'll got -1
it works in the English language but when I put a Persian word instead of "book" the result will shown -1

any way to use the Persian language in that place?
 

Saeedgh837

Client
Регистрация
09.04.2019
Сообщения
56
Благодарностей
1
Баллы
8
ah the problem was that i need to put whole line instead of book. thanks
 

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