sorting numbers

  • Автор темы Автор темы archel
  • Дата начала Дата начала

archel

Client
Регистрация
02.05.2011
Сообщения
175
Реакции
22
Баллы
18
Hi

I would like to know what the easiest way would be to sort the following:

100|test
5|test
2|test
10|test

into

2|test
5|test
10|test
100|test

I could use java and logic if to check line per line but that seems to be a lot of work for something simple.

Thanks in advance.
Steven
 
C#:
Развернуть Свернуть Копировать
var lst = project.Lists["MyList"];
var rez = lst.Select(x => x).OrderBy(x => int.Parse(x.Split('|')[0])).ToList();
upload_2016-5-14_10-40-12.png
 
  • Спасибо
Реакции: archel
Thanks for the response. I'll try this out when I can.
 
  • Спасибо
Реакции: Radzhab
Hi

I just tried it but can't seem to get it to work. The file content of the list stays the same. See image.
Any idea what I do wrong?

Thanks

Steven
zenno.png
 

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