Q: csvHelper string[][] to string[] I have some data in csv like
string[][] items = new string[][] {
  new string[] { "dog", "3" },
  new string[] { "cat", "2" },
  new string[] { "bird", "1" }
};

now  I want to convert the input into properly formatted CSV lines and return them  - expected output:
string[] csvLines = {"\"dog\";\"3\"", "\"cat\";\"2\"", "\"bird\";\"1\""};

or file:
"dog";"3"
"cat";"2"
"bird";"1"

what I've tried:
public static IEnumerable<string> GetCSVLines(string[][] list)
{
    using (MemoryStream stream = new MemoryStream())
    using (StreamWriter writer = new StreamWriter(stream))
    using (CsvHelper.CsvWriter csv = new CsvHelper.CsvWriter(writer))
    {
        foreach (var item in list)
        {
            foreach (var field in item)
            {
                csv.WriteField(field);
            }
            yield return csv.Record; //??
            csv.NextRecord();                  
        }                 
    }
}

Note: I can't just use string.Join() because the fields could contain ", delimiter ; or linebreaks.

A: If you want to wrap items in quotations (with escapement: "ab\"c" should be "\"ab\"\"c\"") and Join them with ; you don't need CsvHelper but a simple Linq
  string[][] items = new string[][] {
    new string[] { "dog", "3" },
    new string[] { "cat", "2" },
    new string[] { "bird", "1" },
    new string[] { "e\"sc", "4" } // escapment demo
  };

  string[] result = items
    .Select(line => string.Join(";", 
       line.Select(item => "\"" + item.Replace("\"", "\"\"") + "\"")))
    .ToArray();

  Console.Write(string.Join(Environment.NewLine, result));

Outcome:
"dog";"3"
"cat";"2"
"bird";"1"
"e""sc";"4"


A: I would say that @Dmitry Bychenko's answer is more straight forward, but if you did want to use CsvHelper it is possible.
public static IEnumerable<string> GetCSVLines(string[][] list)
{
    using (MemoryStream stream = new MemoryStream())
    using (StreamWriter writer = new StreamWriter(stream))
    using (CsvHelper.CsvWriter csv = new CsvHelper.CsvWriter(writer))
    using (StreamReader reader = new StreamReader(stream))
    {
        csv.Configuration.ShouldQuote = (field, context) => true;
        csv.Configuration.Delimiter = ";";

        foreach (var items in list)
        {
            foreach (var item in items)
            {
                csv.WriteField(item);
            }                    
            csv.NextRecord();

            writer.Flush();
            stream.Position = 0;

            yield return reader.ReadToEnd().TrimEnd('\n');

            stream.Position = 0;
        }   
    }
}

