C# Permutation of an array of arraylists?

后端 未结 13 906
难免孤独
难免孤独 2020-11-27 18:10

I have an ArrayList[] myList and I am trying to create a list of all the permutations of the values in the arrays.

EXAMPLE: (all values are strings)

         


        
13条回答
  •  再見小時候
    2020-11-27 18:35

    I'm surprised nobody posted the LINQ solution.

    from val0 in new []{ "1", "5", "3", "9" }
    from val1 in new []{ "2", "3" }
    from val2 in new []{ "93" }
    select String.Format("val0={0};val1={1};val2={2}", val0, val1, val2)
    

提交回复
热议问题