Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Linq;
- public static string Repeat(this string str, int n) {
- return new string('X', n).Replace("X", str + '\n');
- }
- List<string> list1 = new List<string>() {"foo", "baz", "bar", "yada"};
- List<int> list2 = new List<int>() { 1,2,3,4,5 };
- var result = list1.Zip(list2, (first, second) => first.Repeat(second));
- foreach (var r in result) {
- Console.WriteLine(r);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement