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

  • Home
  • SEARCH
  • 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 6754205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:15:08+00:00 2026-05-26T13:15:08+00:00

Morning all, I have a simple question that I could do with some help

  • 0

Morning all,

I have a simple question that I could do with some help with.
I need to create a list of strings that will start with A and finish at some other point e.g BBB, but I am not sure the best and fastest way of doing it.

Thanks in advance.

Ok as requested more information.

I need to create a simple way of creating a list of bays for a warehouse. This wareshouse can have a variable number of Aisles in it, a variable number of rows in each aisle and a variable number of bins for the row. So when the user comes to setup their particular warehouse they can specify the start letter of the Aisle and the end letter of the Aisle.

As you can now see the hardcoded list from A to … isn’t going to work.

  • 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-26T13:15:09+00:00Added an answer on May 26, 2026 at 1:15 pm

    No error checking (start number could be greater than end number in which case you would get an infinite loop) but the code works fine.

    Hope you at least understand it before submitting it!

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace testList
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.Write((int)'A');
                Console.Write((int)'Z');
                Console.WriteLine("Whats the starting string?");
                string start = Console.ReadLine().ToUpper();
                Console.WriteLine("Whats the end string?");
                string end = Console.ReadLine().ToUpper();
    
                List<string> retVal = new List<string>();
                retVal.Add(start);
    
                string currentString = start;
                while (currentString != end)
                {
                    currentString = IncrementString(currentString);
                    Console.WriteLine(currentString);
                    retVal.Add(currentString);
                }
                retVal.Add(end);
                Console.WriteLine("Done");
                Console.ReadKey();
            }
    
            private static string IncrementString(string currentString)
            {
                StringBuilder retVal = new StringBuilder(currentString);
                char endChar= currentString[currentString.Length - 1];
                for (int x = (currentString.Length - 1); x >= 0; x--)
                {
                    char c = currentString[x];
                    if (TryIncrementChar(ref c))
                    {
                        retVal[x] = c;
                        break;
                    }
                    else
                    {
                        retVal[x] = 'A';
                        if (x == 0)
                        {
                            retVal.Insert(0,'A');
                        }
                    }
                }
                return retVal.ToString();
    
            }
            private static bool TryIncrementChar(ref char currChar)
            {
                if (currChar != 'Z')
                {
                    currChar++;
                    return true;
                }
                return false;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good morning all, i want to create an event in MySQL that will UPDATE
Good Morning All, I have an Objective C question that is coming from JavaScript.
Morning all, I know that this sounds like a simple referencing problem from the
Morning all...thicky, newbie Rich here! I have a very simple set up, three different
Morning All, I have been writing an ever so simple IRC client in visual
Good morning all, i have a new question: I'm trying to save into mysql
Good Morning All, I have inherited an ASP.net website that was originally started back
Pretty simple question but I'm having a rough morning it seems. I have the
Morning All, I have an Allowed systems field in my record that can contain
Good morning all, I'm sure this is a gimme, but I have no idea

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.