Join IEnumerable With Comma - CSharp System.Collections.Generic

CSharp examples for System.Collections.Generic:IEnumerable

Description

Join IEnumerable With Comma

Demo Code


using System.Linq;
using System.Collections.Generic;
using System;//from w ww.j a v a 2 s  .  c o m

public class Main{
        public static string JoinWithComma(this IEnumerable<string> enumerable)
        {
            return enumerable.Join(", ");
        }
        public static string Join(this IEnumerable<string> enumerable, String delimiter)
        {
            return String.Join(delimiter, enumerable);
        }
}

Related Tutorials