fork download
  1. using static System.Console;
  2. using System.Linq;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var header = new string[2] { "nome", "endereco" };
  7. var joao = new string[2] { "joão", "rua santa cruz, 28" };
  8. var json = header.Zip(joao, (head, data) => "\"" + head + "\" : \"" + data + "\"");
  9. foreach (var item in json) WriteLine(item);
  10. }
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/436595/101
Success #stdin #stdout 0.02s 16992KB
stdin
Standard input is empty
stdout
"nome" : "joão"
"endereco" : "rua santa cruz, 28"