Getting all the combinations in an array

c#

Solution

These should give you a starting point: http://www.interact-sw.co.uk/iangblog/2004/09/16/permuterate http://www.codeproject.com/KB/recipes/Combinatorics.aspx

Problem

Say I have the following array: ``` var arr = new[] { "A", "B", "C" }; ``` How can I produce all the possible combinations that contain only two characters and no two the same (e.g. `AB` would be the same as `BA`). For example, using the above array it would produce: ``` AB AC BC ``` Please note that this example has been simplified. The array and the length of the string required will be greater. I'd really appreciate if someone could help.

Original source