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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:21:41+00:00 2026-06-11T02:21:41+00:00

I hope I am wording my question the right way, and using the correct

  • 0

I hope I am wording my question the right way, and using the correct terminology. I have an array of student names, arrSummary, that is distinct (no duplicates).

Then, I have another array, arrTest1, that contains a list of the same students’ names and their test scores on Test1. Then I have a third array, arrTest2, that contains a list of their names and their test scores on Test2.

arrTest1 and arrTest2 are such that arrTest1[0].Name = "Bob" and arrTest1[0].Score = "98".

How do I make the array, arrSummary, such that arrSummary[0].Name = "Bob", arrSummary[0].Score1 = "98", arrSummary[0].Score2 = "76"?

There are different types in the array (string, integer, integer).

  • 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-11T02:21:43+00:00Added an answer on June 11, 2026 at 2:21 am
    var arrSummary = arrTest1.Join(arrTest2, person => person.Name, person => person.Name
        , (first, second) => new
        {
            Name = first.Name,
            Score1 = first.Score,
            Score2 = second.Score,
        })
        .ToArray();
    

    Note that this is querying the first two arrays and creating a brand new array. Here I used an anonymous type for the query result; if the query results will be used outside of this method you’ll want to make a new class with those 3 properties and project the results to instances of that type (just put that type after new).

    You can’t change the dimensions, the type, or even the size of an array once it is created. If the summary array already is of a type that has all three properties then you could in theory go through and populate it, but it would probably be easier to just generate the summary array from scratch, which is why that’s what I’ve done here.

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

Sidebar

Related Questions

first of all, I hope that I ask the question in the right context
it's my first question here and I hope that I'm doing it right. I
I hope I'm not breaking any rules by asking a question that pertains to
I hope I'm wording my question properly, but what I'm trying to do is
I've got a quick question that I hope someone can help me with. I'm
I have a simple JsonResult that right now, whilst I am working it out,
This is my first question to SO, I hope to get it right. In
I hope this question isn’t too right field and I'll be upfront in saying
Hope that someone can share their experience with some of the latest emerging backbone.js
Hope you all are fine and rocking your code editors. My question is how

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.