score:8
Accepted answer
You can do it with Enumerable.Zip method like this:
var joined = array1.Zip(array2, (first, second) => first + " " + second);
score:8
You can do it with LINQ using Zip
:
var res = array1.Zip(array2, (a, b) => $"{a} {b}").ToArray();
Note: If you do not have the latest compiler, use a+" "+b
instead of $"{a} {b}"
.
Source: stackoverflow.com
Related Query
- C# Join Strings of two arrays
- How to join two arrays in C# using a single line of code
- how to join two arrays with linq
- Full outer join of two string arrays
- Need to join two strings if both contain values, or return one value if first is NULL
- How to join two arrays in a LINQ query and use the result further in the query?
- GroupBy arrays of strings by two Keys and sum a value
- Join two arrays and get tuple
- Code throws Invalid cast exception: linq-sql join two tables
- error :Could not find an implementation of query for source type datatable and join not found while trying to join two datatables
- How do I concatenate two arrays in C#?
- Comparing two string arrays in C#
- Adding/summing two arrays
- How do I take the Cartesian join of two lists in c#?
- LINQ join two DataTables
- How do I get the differences between two string arrays in C#?
- How to Left Outer Join two DataTables in c#?
- Get different and common items in two arrays with LINQ
- How to join two Lists based on common property
- Left join on two Lists and maintain one property from the right with Linq
- Combining arrays of strings together
- count number of identical elements in two arrays in linq
- Convert an object array of object arrays to a two dimensional array of object
- Generating the Shortest Regex Dynamically from a source List of Strings
- A better way to find a difference between two arrays
- Find number of characters mutual between two strings in C#
- Join two lists of different length
- Two arrays into one Dictionary
- Filtering two arrays to avoid Inf/NaN values
- Join two tables using linq, and fill a Dictionary of them
More Query from same tag
- Linq Query to Count Properties per value
- Inserting data into different tables at the same time with Linq-to-SQL
- nearest/equal sum combination if a list of items - LINQ
- Second Linq filter for multiple conditions
- How to get items of an entity's collection property using Linq?
- Linq PredicateBuilder not returning results
- Linq operate with aggregate function
- Subquery in Linq to Entities in Silverlight
- Using GroupBy in Linq: Client side GroupBy is not supported
- Fetching only first element from collection
- Concatenation in a linq statement
- ?? Operator in Lambda LINQ
- Nesting OR using Linq PredicateBuilder
- Argument Exception Was Caught
- Entity framework delete without key
- how should I give the user a selection and grab the guid from that selection
- Get specific column from a dapper result set
- Using LINQ with C# MVC
- Can we create a list that contains three lists with different amount of values?
- Return single column with Linq
- LINQ - Limit result based on count returned by custom function
- Control not visible even visibility set to visible
- User.Identity.Name becoming null but I cant understand why
- How to return IGrouping from Linq query when grouping
- How to use union between two different object in linq
- Build expression tree for LINQ using List<T>.Contains method
- Insert record into db using linq2sql/datacontext
- Select In Select Statement
- Generate a list of custom objects from Json object using LINQ
- Even easiest join gets complicated in NHibernate