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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:57:32+00:00 2026-06-11T13:57:32+00:00

I will first declare the main question here so you can skip the rest

  • 0

I will first declare the main question here so you can skip the rest if you like.

How do I make result list sorted alphabetically?

public static List<string> GenerateMonthNames(string prefixText)
{
    List<string> items = new List<string>();
    items.Add("a");
    items.Add("appl");
    items.Add("ap");
    items.Add("apple");
    items.Add("change");
    items.Add("world");
    items.Add("engaging");

    string[] strArray = items.ToArray();

    string tempFundstr = string.Empty;
    List<string> returnedList= new List<string>();

    int strNumber;
    int strIndex = 0;
    for (strNumber = 0; strNumber < strArray.Length; strNumber++)
    {
        strIndex = strArray[strNumber].IndexOf(prefixText);
        if (strIndex >= 0)
        {
            tempFoundStr = strArray[strNumber];
            retLst.Add(retstr);
        }    
    }

    items.Clear();
    return returnedList;
}

it was desperate try on Ajax autoComplete just…to get it working, without using Database as source for the autoComplete data

though I have solved main issue, as it wasn’t working at all (;. and now after “fixing” the problem the autoComplete does work. but

it’s kind’a messy solution I have manage to pull in order to iterate through the list or an array the problem here is that I can’t understand how, by using Linq, enumerate or any implementation so i will be able to return the result list sorted alphabetically.

And with your help, i hope to get the code straight (by the book).

  • 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-06-11T13:57:33+00:00Added an answer on June 11, 2026 at 1:57 pm

    Try this:

    public static List<string> GenerateMonthNames(string prefixText)    
    {
        var items = new List<string>();
        items.Add("Oliver");
        items.Add("Olsen");
        items.Add("learns");
        items.Add("how");
        items.Add("change");
        items.Add("world");
        items.Add("engaging");  
    
        var returnList = items.Where(item=>item.Contains(prefixTest)).ToList();
        returnList.Sort();
    
        return returnList;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This will be my first iOS app with any bit of complexity. I'd like
my first question here: I've searched the internet and also read several question and
I will first illustrate my issue with some code: class ExampleClass { private Vector2
I know one awkward solution for this taks will be : first use ct
First I will try to explain what I want to do. The app loads
First I will explain what I am trying to do. I am trying to
I need a regular expression that will match the first letter of a song
I want to define that the first element will be of a specific type,
I'm fairly new to writing test cases and this will be my first major
I have a CSV file. The first row will always contain column headers. Depending

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.