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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:13:45+00:00 2026-05-11T18:13:45+00:00

How can I join 2 lists of equal lengths (to produce a 3rd list

  • 0

How can I join 2 lists of equal lengths (to produce a 3rd list of equal length) where I do not want to specify a condition but simply rely on the order of items in the 2 lists.

Eg how can I join:

{1,2,3,4} with {5,6,7,8}

to produce:

{{1,5}, {2,6}, {3,7}, {4,8}}

I have tried the following:

from i in new []{1,2,3,4}
from j in new []{5,6,7,8}
select new { i, j }

but this produces a cross join. When I use join, I always need to specify the “on”.

  • 1 1 Answer
  • 1 View
  • 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-11T18:13:45+00:00Added an answer on May 11, 2026 at 6:13 pm

    You could use Select in the first list, use the item index and access the element on the second list:

    var a = new [] {1,2,3,4};
    var b = new [] {5,6,7,8};
    
    var qry = a.Select((i, index) => new {i, j = b[index]}); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I join 2 Point3f arrays together? I have tried this but it
Might be simple but can´t find why I cannot access list attributes in my
How I can join this queries to single select (without temp table)? SELECT t2.value,
Ok so I know we can join tables 'across' in MySQL to tables using
in F#, array.append can join two arrays; is there a way to append 2
In Vim, one can join two lines by typing capital J. However, these are
Can I join SELECT and UPDATE statement? If yes, how can I do that?
Can i join two tables using LINQ for NHibernate like I can do in
According to the release notes of Eclipse 3.3 you can now join lines together
ab.txt 30 abcd 45 sadsad ac.txt 50 ab 430 sadsad how can i join

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.