Remove all entries longer than X characters from a list

synapsol

Client
Регистрация
26.11.2012
Сообщения
16
Благодарностей
1
Баллы
3
Hi guys, I want to remove all entries (letters and numbers) from a list that are longer than 30 chars. What's the best way to do this? I couldn't find any built in option in Zennoposter, so I tried to achieve this using regular expressions but couldn't figure it out. Can anyone help?

Thanks!
 

SergSh

Client
Регистрация
10.05.2017
Сообщения
541
Благодарностей
395
Баллы
63
C#:
var list = project.Lists["myList"];
int characters = 30;
for(int i = list.Count - 1; i >= 0; i--)
{
    if(list[i].Length > characters)
    {
        list.RemoveAt(i);
    }
}
 
  • Спасибо
Реакции: synapsol

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