Generate Combinations of generic list
问题 I need to create a list from another list that contains every combination possible. In researching possible solutions I have found many interesting approaches but all seem to generate results based on the count of records provided. I need the combinations to increase to a max threshold. i.e. consider the following array 1,2,3,4,5 I need the results to look similar to (threshold is 3 in this example) 1 1,2 1,2,3 1,2,4 1,2,5 1,3,4 2,3,5... etc In actuality, the data will be IEnumerable. I used