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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…