Finding All Combinations (cartesian product) of list values in vb.net
问题 How can I produce all of the combinations of the values in N number of vb list of variable lengths? Let's say I have N number of vb lists, e.g. first = {'a', 'b', 'c', 'd'} second = {'e'} third = {'f', 'g', 'h', 'i', 'j'} (Three list in this example, but its N number of lists for the problem.) And I want to output all the combinations of their values, to produce a list of lists in the order. { {a,e,f} {a,e,g} {a,e,h} {a,e,i} {a,e,j} {b,e,f} {b,e,g} .... {d,e,j} } 回答1: A simple way to