During the development process. The handling of arrays and collections is the most worrying. Some operations are typically handled with a for or foreach. Here are some commonly used sets and arrays of operation functions.
First, for example, 2 sets, A, B.
list<int> ListA = new list<int> {1,2,3,5,7,9};
list<int> Listb = new list<int> {13,4,17,29,2};
Lista.addrange (LISTB); Merges the collection a.b list<int> Result = lista.union (LISTB). Tolist<int> (); Reject duplicates list<int> Result = Lista.concat (LISTB). Tolist<int> (); Keep Duplicates
Lista.binarysearch ("1");//Determines whether a value is included in the collection. Returns 0 if included
In an example of two arrays
Int[] I=new int[]{1,2}; Int[] J=new int[]{2,3}; list<int> r = new list<int> ();
R.addrange (i);
R.addrange (j);
Int[] C = R.toarray (); Merging arrays
Int[] X=i.union (j). Toarray<int> (); Reject Duplicates
Int[] X=i.concat (j). Toarray<int> (); Keep Duplicates
int n = array.binarysearch (i,3);//Determines whether a value is included in the array. Returns 0 if included
C # Operations on multiple collections and arrays (merging, de-weighing, judging)