Tell me how to sort this array of strings:
"text ‡ 11: 35"
"other_text ‡ 16: 30"
"other_text1 ‡ 00: 30"
...
"more_other_text ‡ 12: 30"
So that the lines themselves remain the same lines (cannot be changed) by increasing the time at the end of the line, and the lines with the ending 00:** went to the end also sorted in ascending order in their group.
Please describe in words or by example in C #.
After trial and error, the desired grade turned out with the help of A Petrov , this code sorted - as it should.
private void SortLinksBySessTime() { string[] result = (from s in sessLinks let dt = DateTime.Parse(s.Substring(s.Length - 5)) let dt2 = dt.Hour == 0 ? dt.AddDays(1) : dt orderby dt2 select s) .ToArray(); }