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 Articles
- C# Join Strings of two arrays
- How to join two arrays in C# using a single line of code
- Combining arrays of strings together
- Generating the Shortest Regex Dynamically from a source List of Strings
- Left outer join using LINQ -- understanding the code
- Join unique strings from an array of objects
- LINQ Source Code Available
- Cross join of unknown number of string arrays using linq
- .NET 4 Code Contracts: "requires unproven: source != null"
- LINQ query over a list of Bool+String pairs. How to join strings without foreach?
- how to join two arrays with linq
- How can I code an outer join using LINQ and EF6?
- Query expressions over source type 'dynamic' or with a join sequence of type 'dynamic' are not allowed
- creating Linq to sqlite dbml from DbLinq source code
- Full outer join of two string arrays
- How to JOIN strings efficiently in linq?
- Handling very large strings between SQL Server and .NET code +LINQ
- Build where clause from arrays of strings using contains keyword in SQl Server
- Need to join two strings if both contain values, or return one value if first is NULL
- Join 2 lists on empty strings with Anonymous types in Linq
- Join multiple strings with delimiters
- source code for LINQ 101 samples
- SQL code to join to, and sum data in, a table referenced by comma delimited keys
- 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
- Linq Query join a table to a List<string> object to find any Strings not in table
- Join 2 arrays using LINQ with condition
- How to join one row to every row in source table using LINQ
- Create a tree structure in linq with a single list source with parent - child as strings of an object
- List or Array of String Contain specific word in Html Source Code
- Changing my stored procedure to Linq
- Join 2 tables with multiple references in LINQ
- Insert multiple rows to a table with 1 hit to the database
- Linq assign to a List<> List Binding
- LINQ expression to find if there are any matches between two arrays of string
- LINQ group-by and then display datetime for (dd mmm)
- Unable to Use IsLike operator on first table in nhibernate
- c# LINQ joining two lists
- How can I make Linq extension method available for the entities?
- How to groupby list in c# and show result without foreach?
- reduce number of LINQ queries
- How to query grand children from a list of persons?
- LINQ to Entities: Get more recent date from each group
- C# - Remove duplicate objects using LINQ
- Get Last Record from Multiple Records and save result in LINQ List
- LINQ sorting on objects on subobject
- Linq Join using bit mask logic
- How to do sum of a column with LINQ?
- LINQ Join through 3 tables to Sum one column
- Add a column to an IEnumerable in c#