Skip to content

Instantly share code, notes, and snippets.

@jonpryor
Created December 2, 2019 20:15
Show Gist options
  • Save jonpryor/80e266e02add71244b47a70da5c00fc8 to your computer and use it in GitHub Desktop.
Save jonpryor/80e266e02add71244b47a70da5c00fc8 to your computer and use it in GitHub Desktop.
using System;
using System.IO;
class App {
public static void Main (string[] args)
{
foreach (var file in args) {
var content = File.ReadAllText (file);
var lines = content.Split ('\n');
foreach (var line in lines) {
Console.WriteLine ($"'{line}' {line.Length}");
}
}
}
}
@jonpryor
Copy link
Author

jonpryor commented Dec 2, 2019

C:\Users\jopryo\tmp>.\endline.exe endline.cs
' 14ng System;
' 17ng System.IO;
' 1
' 12ss App {
' 44 public static void Main (string[] args)
' 6  {
' 37     foreach (var file in args) {
' 51         var content = File.ReadAllText (file);
' 46         var lines = content.Split ('\n');
' 42         foreach (var line in lines) {
' 63             Console.WriteLine ($"'{line}' {line.Length}");
' 14         }
' 10     }
' 6  }
'}' 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment