SHARE
TWEET

Untitled

a guest Jul 11th, 2013 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 192.168.1.5
  2. 69.52.220.44
  3. 10.152.16.23
  4. 192.168.3.10
  5. 192.168.1.4
  6. 192.168.2.1
  7.        
  8. 10.152.16.23
  9. 69.52.220.44
  10. 192.168.1.4
  11. 192.168.1.5
  12. 192.168.2.1
  13.        
  14. var unsortedIps =
  15.     new[]
  16.     {
  17.         "192.168.1.4",
  18.         "192.168.1.5",
  19.         "192.168.2.1",
  20.         "10.152.16.23",
  21.         "69.52.220.44"
  22.     };
  23.  
  24. var sortedIps = unsortedIps
  25.     .Select(Version.Parse)
  26.     .OrderBy(arg => arg)
  27.     .Select(arg => arg.ToString())
  28.     .ToList();
  29.        
  30. 69.52.220.44 =>
  31.  
  32. 69 * 255 * 255 * 255 +
  33. 52 * 255 * 255 +
  34. 220 * 255 +
  35. 44
RAW Paste Data
Top