SHARE
TWEET

Untitled

a guest Jun 13th, 2014 369 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SplitLINQTest
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var rates = "50.8,10,1;0.0001,60,0;50,0,0;";
  14.             var OpenDate = DateTime.Parse("01.04.2014");
  15.             var res =
  16.                 string.Join("\n",
  17.                     from parts in rates.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries)
  18.                                        .Select(p => p.Split(',').Select(double.Parse).ToList())
  19.                     let date = OpenDate.AddDays(parts[1])
  20.                     let output = string.Format("{0}\t{1:d}", parts[0], date)
  21.                     orderby parts[2] descending
  22.                     select output);
  23.             Console.WriteLine(res);
  24.         }
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top