Guest User

Untitled

a guest
Jun 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. Console.WriteLine(output);
  2. var q = from n in records select new
  3.         {
  4.             Zip      = new Func<string, string>((s) =>
  5.             {
  6.                 if (s != null)
  7.                 {
  8.                     string[] split = s.Split(new char[] { '-' });
  9.  
  10.                     if (split[0].Length == 5)
  11.                     {
  12.                         return split[0];
  13.                     }
  14.                 }
  15.                 return string.Empty;
  16.  
  17.             })(n.ZipCode),
  18.             ZipPlus4 = new Func<string, string>((s) => { return s.Substring(6, 10); })(n.ZipCode)
  19.         };
Add Comment
Please, Sign In to add comment