Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6055627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:17:08+00:00 2026-05-23T08:17:08+00:00

All, I have been beating my head against the wall for two days on

  • 0

All, I have been beating my head against the wall for two days on this one. I have googled and googled and I can’t seem to find a solution. Here is what I have:

I have from two to six different string arrays (depending upon a user’s selection) but for this question lets assume 3 separate string arrays:

  • Array1 – Tom, Dick, Harry
  • Array2 – Eats, Cooks, Drinks
  • Array3 – Soup, Soda, Salad

I want the resulting Array to contain all possible combinations of these three string arrays but I don’t want to combine the values contained in the same list (no: Tom Dick Harry). This is how I was the resulting array to look:


  1. Tom Eats Soup
  2. Tom Eats Soda
  3. Tom Eats Salad
  4. Dick Eats Soup
  5. Dick Eats Soda
  6. Dick Eats Salad
  7. Harry Eats Soup
  8. Harry Eats Soda
  9. Harry Eats Salad

I’m looking for a VB6 solution but I would appreciate a solution or Algorithm in most any other programming language.

Thank you in advance for your helpful suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:17:09+00:00Added an answer on May 23, 2026 at 8:17 am

    If this is all you have to do, just do a triple-nested for loop:

    for(int i = 0; i < 3; i++) {
        for(int j = 0; j < 3; j++) {
             for(int k = 0; k < 3; k++) {
                 output array1[i] + " " array2[j] + " " + array3[k]; 
             }  
        }
    }
    

    You can translate to VB6. Modern languages like C# and VB.NET will let you express this more beautifully:

    string[] names = new[] { "Tom", "Dick", "Harry" };
    string[] verbs = new[] { "Eats", "Cooks", "Drinks" };
    string[] foods = new[] { "Soup", "Soda", "Salad" };
    
    var combinations = from name in names
                       from verb in verbs
                       from food in foods
                       select String.Join(" ", new[] { name, verb, food });
    
    foreach(var combination in combinations) {
        Console.WriteLine(combination);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been beating my head in the wall all evening on this, can
So, I've been beating my head against the wall of this issue for several
I'm beating my head against a wall on this one; the logo image (It's
I've been beating my head against my desk for the last two days over
I've been beating my head against this for awhile to no avail. I have
I have been reading all over the web about this and still can't understand
Here's what i have been beating my head against for a day now. I
I have been all over this one, and I am just plumb stuck. I
I can't seem to find a straight answer for this: I have a HTML
I've been beating my head against the keyboard for a better of 3 days

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.