Say I have a list of string
List<string> lst=new List<string>(new string[]{"a","b","c","d"});
I wish to get element from index 0 to index 2 assign it to another List lst1(i.e. the element of lst is {"a","b"}), then remove it from lst (i.e. lst becomes {"c","d"}, what’s the quickest way of doing this? I am thinking is there any command like
List<string> lst=new List<string>();
lst1=lst.getElements(1,2);
lst.remove(1,2);
Use GetRange() to copy of a range of elements and RemoveRange() to removes a range of elements.
Example :
Good Luck !!