I have 4 lists in C #, how can I make a list of them. means to say, make a list from the result of 4 lists.
To achieve this, you can also use the List constructor.
Sort of
List<string> list1 = new List<string>(); List<string> list2 = new List<string>(); List<string> list3 = new List<string>(); ... List<string> concat = new List<string> (list1.Concat(list2).Concat(list3));
Your question is not very clear, but I suspect you mean something like:
List<List<string>> stringLists = ...; // SelectMany is a "flattening" operation List<string> singleList = stringLists.SelectMany(list => list).ToList();
Use List.AddRange to add one list to another.
List<string> list1 = new List<string>() { "rabbit", "hat" }; List<string> list2 = new List<string>() { "frog", "pond" }; list2.InsertRange(0, list1);
Source: https://habr.com/ru/post/1766208/More articles:Permutation using two variables is not three? - programming-languages | fooobar.comValidating a Django form, including using session data - pythonPHP How to delete lines less than 6 characters long - phpHow to make a PHP session expire when you close your browser OR some lengthy time - phpscrewed vim / gvim on ubuntu royally. how can i get back to square - vimУведомление о подключении Android - androidADOdb returns column names and numeric indices - phpExtract text from PDF to bookmarks - javaXcode: how to wrap a long line to the next line in the xcode editor - iphoneHow to create a directory, but delete it if it already exists in Perl? - perlAll Articles