Want to join the items inside the string array say with, delimiter using LINQ in C#? It’s pretty easy.
Below is a sample code snippet demonstrating in easy steps on how to concatenate a string array using LINQ in C#?
Concatenate or Join a string Array using LINQ in C#
using System; using System.Collections.Generic; using System.Data; using System.Linq; namespace AbundantCode { internal class Program { //Concatenate or Join a string Array using LINQ in C# private static void Main(string[] args) { string[] AbundantArray = new string[] { "Abundantcode", "is", "a sourcecode site" }; var result = AbundantArray.Aggregate((m, n) => m + "," + n); Console.WriteLine(result); Console.ReadLine(); } } }
Leave a Reply