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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:14:23+00:00 2026-06-15T15:14:23+00:00

User enters a series of values into textboxes: Textbox 1: 10,9,8,7 Textbox 2: 1,2,3,4

  • 0

User enters a series of values into textboxes:

Textbox 1: 10,9,8,7

Textbox 2: 1,2,3,4

Id then like to sort these two string and populate a List<string>. Once sorted (already figured out how to do that part), id like to create a jagged array of the inputs like so:

string[][] Arr = new string[2][];

Arr[0] = new string[] { "10", "9", "8", "7" };
Arr[1] = .....

but instead of manually typing in the values, id like to use the List<string> mentioned above.

Is this possible (thus far, my attempts have failed rather miserably)? If not, could someone suggest a possible alternative approach?

Thanks for your time!

EDIT: Based on the answers, I got it working. Sorry again for not making it clear what I meant by sort.

List<string> tempString = new List<string>();
tempString.Add("10,9,8,7");
tempString.Add("1,2,3");

string[][] Arr = new string[2][];

for (int x = 0; x < 2; x++)
{
    string[] values = tempString[x].Split(',').ToArray();

    Arr[x] = values;
}
  • 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-15T15:14:24+00:00Added an answer on June 15, 2026 at 3:14 pm

    Create lists from the strings:

    List<string> list1 = new List<string>(textbox1.Text.Split(','));
    List<string> list2 = new List<string>(textbox2.Text.Split(','));
    

    Sort the lists:

    list1.Sort();
    list2.Sort();
    

    Now you can easily create arrays from the lists:

    string[][] Arr = new string[2][];
    Arr[0] = list1.ToArray();
    Arr[1] = list2.ToArray();
    

    If you want to do it in the other order, i.e. first sort then split, it would be:

    List<string> list = new List<string>();
    list.Add(textbox1.Text);
    list.Add(textbox2.Text);
    list.Sort();
    string[][] Arr = new string[2][];
    Arr[0] = list[0].split(',');
    Arr[1] = list[1].split(',');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's user story: User enters address: Paris, France. Then I would like to display
A user enters URLs in a box like this: google.net google.com I then try
How to validate that user enters string in textbox in asp mvc4? What to
When a user enters a search query, I'd like to track: 1) Their search
When a user enters captcha and then clicks download on a file hosting site
I have a string mystring that the user enters. I check that it is
I have a UI where the user enters a number into a text box,
User enters pairs of values. I need to replicate the last set and renumber
User enters numbers to 10 textbox and i sent them to an array. Now
My Aim - User enters ClientName into autocomplete and selects ClientName. On selection, Apply

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.