Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SplitLINQTest
- {
- class Program
- {
- static void Main(string[] args)
- {
- var rates = "50.8,10,1;0.0001,60,0;50,0,0;";
- var OpenDate = DateTime.Parse("01.04.2014");
- var res =
- string.Join("\n",
- from parts in rates.Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries)
- .Select(p => p.Split(',').Select(double.Parse).ToList())
- let date = OpenDate.AddDays(parts[1])
- let output = string.Format("{0}\t{1:d}", parts[0], date)
- orderby parts[2] descending
- select output);
- Console.WriteLine(res);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement