Last active
December 29, 2015 19:19
-
-
Save Ellyll/7716439 to your computer and use it in GitHub Desktop.
Read a text file and sort in C#, for http://devblog.avdi.org/2013/10/16/sorting-lines-in-5-languages/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Linq; | |
namespace SortingExample | |
{ | |
public class Sorter | |
{ | |
static void Main(string[] args) | |
{ | |
var lines = File.ReadAllLines(args[0]).OrderBy(a => a); | |
File.WriteAllLines(args[1], lines); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment