TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deepak M
1.2k
546
36.7k
How to get all possible combinations ?
Dec 16 2019 3:52 AM
I have n numbers of array contains n number of data.
I want to write out all the possible combinations.
For ex:-
var list1 = new List<string> { "A", "B", "C", "D" };
var list2 = new List<string> { "10", "20", "30", "40", "50" };
var list3 = new List<string> { "ABC", "DEF", "GHI", "JKL" };
Possible outputs :
A-10-ABC
A-10-DEF
A-10-GHI
A-10-JKL
A-20-ABC
A-20-DEF
A-20-GHI
A-20-JKL
A-30-ABC
A-30-DEF
A-30-GHI
A-30-JKL
........ and so on
The actual problem is the number of list variable is not constant, therefore I can't just write a fixed amount of nested loop.
Hope someone can help me....
Reply
Answers (
2
)
How to Save/Export DataGridview into a single document ?
Getting 500 Internal Server Error in POST Request HttpClient