using System;
using System.Collections.Generic;
using System.Linq;
public class Test
{
public static void Main()
{
var strings = new List<String>();
strings.Add("Paul");
strings.Add("Darren");
strings.Add("Joe");
strings.Add("Jane");
strings.Add("Sally");
var firstMatch = strings.FirstOrDefault(s => s.StartsWith("J"));
if(firstMatch != null)
{
Console.WriteLine(firstMatch);
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkxpbnE7CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJdmFyIHN0cmluZ3MgPSBuZXcgTGlzdDxTdHJpbmc+KCk7CiAgICAgICAgIHN0cmluZ3MuQWRkKCJQYXVsIik7CiAgICAgICAgIHN0cmluZ3MuQWRkKCJEYXJyZW4iKTsKICAgICAgICAgc3RyaW5ncy5BZGQoIkpvZSIpOwogICAgICAgICBzdHJpbmdzLkFkZCgiSmFuZSIpOwogICAgICAgICBzdHJpbmdzLkFkZCgiU2FsbHkiKTsKICAgICAgICAgdmFyIGZpcnN0TWF0Y2ggPSBzdHJpbmdzLkZpcnN0T3JEZWZhdWx0KHMgPT4gcy5TdGFydHNXaXRoKCJKIikpOwogICAgICAgIGlmKGZpcnN0TWF0Y2ggIT0gbnVsbCkKICAgICAgICB7CiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKGZpcnN0TWF0Y2gpOwogICAgICAgIH0KCX0KfQ==