Skip to content

Instantly share code, notes, and snippets.

@masaru-b-cl
Created February 8, 2013 06:31
Show Gist options
  • Select an option

  • Save masaru-b-cl/4737094 to your computer and use it in GitHub Desktop.

Select an option

Save masaru-b-cl/4737094 to your computer and use it in GitHub Desktop.
DynamicLTSV usage
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DynamicLTSVSample
{
class Program
{
static void Main(string[] args)
{
// parse LTSV line
var line = DynamicLTSV.ParseLine("hoge:foo\tbar:baz\n");
Console.WriteLine(line.hoge); // foo
Console.WriteLine(line.bar); // baz
// parse LTSV lines
var lines = DynamicLTSV.Parse(@"hoge:foo
bar:baz
");
Console.WriteLine(lines.First().hoge); // foo
Console.WriteLine(lines.Last().bar); // baz
// create LTSV line
var ltsv = DynamicLTSV.Create();
ltsv(hoge: "fuga", bar: "baz");
Console.WriteLine(ltsv.ToString()); // hoge:fuga\tbar:baz
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment