fork download
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5.  
  6. public class Test
  7. {
  8.  
  9.  
  10. public static void Main()
  11. {
  12. var list = new List<string>(){"67.232,S","98.122,F","12.211,H"};
  13. list = list
  14. .Select(s => new { NumPart = s.Substring(0, s.LastIndexOf(',')), Item = s })
  15. .OrderBy(x => double.Parse(x.NumPart, CultureInfo.InvariantCulture))
  16. .Select(x => x.Item)
  17. .ToList();
  18. foreach(var num in list)
  19. Console.WriteLine(num);
  20. }
  21. }
Success #stdin #stdout 0.05s 34136KB
stdin
Standard input is empty
stdout
12.211,H
67.232,S
98.122,F