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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:34:01+00:00 2026-06-01T00:34:01+00:00

Up to this moment I was using simple arrays to enter and get necessary

  • 0

Up to this moment I was using simple arrays to enter and get necessary information.

the first example is following:

            // ===Example 1. Enter info ////
            string[] testArr1 = null;
            testArr1[0] = "ab";
            testArr1[1] = "2";
            // ===Example 1. GET info ////
            string teeext = testArr1[0];
            // =======================

and the second example:

            // ====== Example 2. Enter info ////
            string[][] testArr2 = null;
            List<int> listTest = new List<int>();
            listTest.Add(1);
            listTest.Add(3);
            listTest.Add(7);
            foreach (int listitem in listTest)
            {
                testArr2[listitem][0] = "yohoho";
            }
            // ====== Example 2. Get info ////
            string teeext2 = testArr2[0][0];
            // =======================

But right now I’m trying to assign an identification number to each array, so I could identify multiple different arrays in one ConcurrentDictionary.

How do you Enter and Get info out of array in dictionary?

Look, we have two identifiers and two dictionaries:

            decimal identifier1 = 254;
            decimal identifier2 = 110;
            ConcurrentDictionary<decimal, string[]> test1 = new ConcurrentDictionary<decimal, string[]>();
            ConcurrentDictionary<decimal, string[][]> test2 = new ConcurrentDictionary<decimal, string[][]>();

I was imagining something like this:

//////////Example 1
//To write info
test1.TryAdd(identifier1)[0] = "a";
test1.TryAdd(identifier1)[1] = "b11";

test1.TryAdd(identifier2)[0] = "152";
//to get info
string value1 = test1.TryGetValue(identifier1)[0];
string value1 = test1.TryGetValue(identifier2)[0];

//////////Example 2
//To write info: no idea
//to get info: no idea

P.S.: The code above doesn’t work (since it’s self-made).. so what’s the right way to enter information into string[] and string[][] in ConcurrentDictionary by an ID? (and to get it out)

  • 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-01T00:34:02+00:00Added an answer on June 1, 2026 at 12:34 am

    Given your declarations

    decimal identifier1 = 254;
    decimal identifier2 = 110;
    ConcurrentDictionary<decimal, string[]> test1 = new ConcurrentDictionary<decimal, string[]>();
    ConcurrentDictionary<decimal, string[][]> test2 = new ConcurrentDictionary<decimal, string[][]>();
    

    you can use code like this

      test1[identifier1] = new string[123];
      test1[identifier1][12] = "hello";
    
      test2[identifier2] = new string[10][];
      test2[identifier2][0] = new string[20];
      test2[identifier2][0][1] = "world";
    

    to enter your data. Here’s an example of accessing the data you entered:

      Console.WriteLine(test1[identifier1][12] + " " + test2[identifier2][0][1]);
    

    I must say, though, that such code tends to be quite convoluted and difficult to debug, especially for the test2 case. Are you sure you want to use jagged arrays?

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

Sidebar

Related Questions

Till this moment I used this method to invoke: public string AddText { set
This is what I have at the moment. <h2>Information</h2>\n +<p>(.*)<br />|</p> ^ that is
At this moment I use this scenario to load OpenGL texture from PNG: load
I have two nested loop in XSL like this, at this moment I use
This is how I do it at the moment. I try to open the
This seems to be defeating me at the moment but I don't think I
At the moment my code looks like this: # Assign values for saving to
At the moment I write stored procedures this way: create proc doStuff @amount int
This is a toy project I'm working on at the moment. My app contains
I am building a cms at the moment using the zend framework and have

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.