using System;
using System.Collections.Generic;
using System.Linq;
public class Test
{
public static void Main()
{
var data = new Dictionary<string,string>{
{"question1", "7"},
{"question1_comment", "pretty difficult"},
{"question2", "9"},
{"question2_comment", ""},
{"question3", "5"},
{"question3_comment", "Never on time"},
};
var res = data
.Keys
.Where(s => !s.EndsWith("_comment"))
.Select(s => new[] {s, data[s], data[s+"_comment"]})
.ToList();
foreach(var a in res) {
Console.WriteLine(string.Join(", ", a.Select(s => string.Format("'{0}'", s)).ToArray()));
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkxpbnE7CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJdmFyIGRhdGEgPSBuZXcgRGljdGlvbmFyeTxzdHJpbmcsc3RyaW5nPnsKICAgICAgICAgICAgeyJxdWVzdGlvbjEiLCAiNyJ9LAogICAgICAgICAgICB7InF1ZXN0aW9uMV9jb21tZW50IiwgInByZXR0eSBkaWZmaWN1bHQifSwKICAgICAgICAgICAgeyJxdWVzdGlvbjIiLCAiOSJ9LAogICAgICAgICAgICB7InF1ZXN0aW9uMl9jb21tZW50IiwgIiJ9LAogICAgICAgICAgICB7InF1ZXN0aW9uMyIsICI1In0sCiAgICAgICAgICAgIHsicXVlc3Rpb24zX2NvbW1lbnQiLCAiTmV2ZXIgb24gdGltZSJ9LAoJCX07CgkJdmFyIHJlcyA9IGRhdGEKCQkgICAgLktleXMKCQkgICAgLldoZXJlKHMgPT4gIXMuRW5kc1dpdGgoIl9jb21tZW50IikpCgkJICAgIC5TZWxlY3QocyA9PiBuZXdbXSB7cywgZGF0YVtzXSwgZGF0YVtzKyJfY29tbWVudCJdfSkKCQkgICAgLlRvTGlzdCgpOwoJCWZvcmVhY2godmFyIGEgaW4gcmVzKSB7CgkJCUNvbnNvbGUuV3JpdGVMaW5lKHN0cmluZy5Kb2luKCIsICIsIGEuU2VsZWN0KHMgPT4gc3RyaW5nLkZvcm1hdCgiJ3swfSciLCBzKSkuVG9BcnJheSgpKSk7CgkJfQoJfQp9