Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

How to clone a list

$
0
0

Hi. Sorry for the 'not XF' question but I don't know where is the right place for this.
I would like to know how to clone a list so I create a second list that not reference the first one.
If I have
List l1 = l2;

And if I modify l1[0].myvalue = 5
The same value is assigned to l2[0].myvalue

how can I have two separate list? I have not found a Clone method...


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>