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 510645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:08:06+00:00 2026-05-13T07:08:06+00:00

List<string> list = new List<string>(); list.Add(A); list.Add(B); List<string> list1 = new List<string>(); list.Add(a); list.Add(b);

  • 0
List<string> list = new List<string>();    
        list.Add("A");
        list.Add("B");

List<string> list1 = new List<string>();    
        list.Add("a");
        list.Add("b");


    for (int i = 0; i < list.Count; i++)
    {
        // print another list items.
        for (int j = 0; j < list1.Count; j++)
        {
            Console.WriteLine("/" + list[i] + "/" + list1[j]);
        }

    }

I want to code like this string tmpS =+ list[i]; to Join the next list item togeter.

then print tmpS

but compile error CS0023: Operator ‘+’ cannot be applied to operand of type ‘string’.

How to print all the items below.(any sort is ok)


A
Aa
Ab
Aab
Aba
AB
ABa
ABb
ABab
ABba
B
Ba
Bb
Bab
Bba

(The Caps number No swap. the small characters should be swaped. and always follow Caps Numbers Append small characters.)

  • 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-13T07:08:06+00:00Added an answer on May 13, 2026 at 7:08 am

    it makes a long time I did not worked on a pure algorithmic problem!

    This program should do the trick:

    class Program
    {
        static void Main(string[] args)
        {
            List<string> uppers = new List<string>();
            uppers.Add("A");
            uppers.Add("B");
    
            List<string> lowers = new List<string>();
            lowers.Add("a");
            lowers.Add("b");
    
            List<string> combinedUppers = GetCombinedItems(uppers);
            List<string> combinedLowers = GetCombinedItems(lowers);
            List<string> combinedUppersLowers = GetCombinedList(combinedUppers, combinedLowers);
    
            foreach (string combo in combinedUppersLowers)
            {
                Console.WriteLine(combo);
            }
    
            Console.Read();
        }
    
        static private List<string> GetCombinedItems(List<string> list)
        {
            List<string> combinedItems = new List<string>();
    
            for (int i = 0; i < list.Count; i++)
            {
                combinedItems.Add(list[i]);
    
                for (int j = 0; j < list.Count; j++)
                {
                    if (list[i] != list[j])
                    {
                        combinedItems.Add(String.Format("{0}{1}", list[i], list[j]));
                    }
                }
            }
    
            return combinedItems;
        }
    
        static private List<string> GetCombinedList(List<string> list1, List<string> list2)
        {
            List<string> combinedList = new List<string>();
    
            for (int i = 0; i < list1.Count; i++)
            {
                combinedList.Add(list1[i]);
    
                for (int j = 0; j < list2.Count; j++)
                {
                    combinedList.Add(String.Format("{0}{1}", list1[i], list2[j]));
                }
            }
    
            for (int i = 0; i < list2.Count; i++)
            {
                combinedList.Add(list2[i]);
    
                for (int j = 0; j < list1.Count; j++)
                {
                    combinedList.Add(String.Format("{0}{1}", list2[i], list1[j]));
                }
            }
    
            return combinedList;
        }
    }
    

    Regards.


    This program gives you this output:

    A
    Aa
    Aab
    Ab
    Aba
    AB
    ABa
    ABab
    ABb
    ABba
    B
    Ba
    Bab
    Bb
    Bba
    BA
    BAa
    BAab
    BAb
    BAba
    a
    aA
    aAB
    aB
    aBA
    ab
    abA
    abAB
    abB
    abBA
    b
    bA
    bAB
    bB
    bBA
    ba
    baA
    baAB
    baB
    baBA

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.