I need to copy an array to a linked list OR transform the array in a linked list.
How this can be done in .NET (C# or VB)?
Thanks
Depending on what version we're taking about here, you can :
LinkedList<YourObjectType> ListOfObjects=new LinkedList<YourObjectType>(YourObjectArray);
To go to LinkedList from array:
var array = GetMyArray();
LinkedList<MyType> list = new LinkedList<MyType>(array);
To go to array from LinkedList:
var array = list.ToArray();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With