How to Copy array to List and Back in C#? -- C# -- Type Conversion

 How to Copy array to List and Back in C#? -- C# -- Type Conversion 


array to List
using ToList method

[e.g.]
list1=arr1.ToList<float>();

List to array 
using CopyTo method

list1.CopyTo(arr1);


[NOTE]
ToList() method is under System.Linq
Don't forget to use using directive.
using System.Linq;

Comments

Popular posts from this blog

String Interpolation(字串內插)

Format a string -- String.Format()