Click here to Skip to main content
15,891,909 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi every one I want to print all combination of n letter by vb.net language
for example my letter are A,B.C,D,E
I Want to have
A
B
C
D
E
AB
AC
AD
AE
BC
BD
BE
CD
......
please help me
thanks
Posted
Comments
Sergey Alexandrovich Kryukov 27-Aug-15 10:36am    
What have you tried so far?
—SA
Richard Deeming 27-Aug-15 15:45pm    
Google will find you lots of code for generating combinations. For example:
Combinations - Rosetta Code[^]

It's in C#, but you should easily be able to convert it to VB.NET.
rezaeti 28-Aug-15 6:10am    
thanks

Start here: Permutations in Visual Basic -- Generating All Possible Combinations[^]

For further information, please see:
https://en.wikipedia.org/wiki/Combination[^]
https://en.wikipedia.org/wiki/Permutation[^]

And please, use Google before you ask a question.
 
Share this answer
 
See my Tip/Trick: Subset - Sum Problem with Numeric Collections [^]
which includes a very efficient way to generate all possible combinations of n items.

(Yes, it is c#, but should be straightforward to convert to VB.)
 
Share this answer
 
v3
Comments
Maciej Los 28-Aug-15 3:11am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900