So, there is a big jagged string array (~ [120] [1 000 000]) here that represents data from an excel worksheet ( columns / rows).
Task: We have to append items at the beginning of each inner array.
I have a solution, but I am not sure about performance.
private string[][] AddField(string[][] exportDataFieldValues, string linkDisplayFieldValue)
{
var newExportDataFieldValues = new List<string[]>();
foreach (var row in exportDataFieldValues)
{
var cellsRange = row.ToList();
cellsRange.Insert(0, linkDisplayFieldValue);
newExportDataFieldValues.Add(cellsRange.ToArray());
}
return newExportDataFieldValues.ToArray();
}
Q: As you can see, my solution contains a lot of type conversions, I believe there is a more effective solution. Сan you provide a more effective solution?