CSharp examples for System:Array Element
Array To Csv File
using System.Linq; using System.IO;/*w w w .jav a 2 s . co m*/ using System; public class Main{ public static void ToCsvFile<T>(this T[,] array, string filename) { var enumerator = array.Cast<T>().Select((s, i) => (i + 1) % array.GetLength(0) == 0 ? string.Concat(s, Environment.NewLine) : string.Concat(s, ",")); var result = string.Join(string.Empty, enumerator.ToArray<string>()); File.WriteAllText(filename, result); } }