Skip to content

Instantly share code, notes, and snippets.

@jonpryor jonpryor/app.cs
Created Dec 2, 2019

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner 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
You can’t perform that action at this time.