using System.Collections.Generic;
using System.Diagnostics;
using System.Text.RegularExpressions;
public static void Main() {
Console.WriteLine("Hello World");
var prog = new Program();
readonly Foo foo = new Foo();
public String s {get; set;}
private void LinqStuff() {
var ints = new List<int>()
var one = from i in ints where i == 2 select i;
var things = new Thing[] {new Thing(){i = 3, s="one"}, new Thing(){i=4, s="two"}};
var ts = from t in things where t.i == 4 select new{str = t.s, jint = 99};
Console.WriteLine("thing: {0}, {1}.", t.str, t.jint);
Console.WriteLine("foo: {foo}");
private void StringTest() {
String field = "A17^A02";
int index = field.IndexOf('^');
String word = field.Substring(0, index);
Console.WriteLine("index = {0} word= {1}", index, word);
String segment = "MSH|F1|F2|F3|F4|F5";
char fieldSeperator = '|';
MatchCollection mc = Regex.Matches(segment, Regex.Escape(fieldSeperator.ToString()));
Console.WriteLine(segment.Insert(mc[4].Index, "Foobar"));
var ints = new List<int>()
int i = ints.FirstOrDefault(x => x == Double.NaN);
Console.WriteLine("i = {0}", i);
Console.WriteLine("num = {0}", "7".PadLeft(7, '0'));
var obs = new[] {new {i = 1, s = "one"}, new {i = 2, s = "two"}, new {i = 3, s = "three"}};
Console.WriteLine("str: {0}", o.s);
var obs2 = obs.Select(o => o.s);
Console.WriteLine("s: {0}", s);
Debug.WriteLine("debug");
public void Conditional() {
Console.WriteLine("conditional");