ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

IEnumerable(string).Join

Joins a series of strings connected by a separator.

Source

public static string Join(this IEnumerable<string> source, string separator) => String.Join(separator, source);

Example

var strings = new List<string> { "Ace", "Bil", "Cal", "Dan" };

var everyone = strings.Join(", "); // returns "Ace, Bil, Cal, Dan"

Author: Entroper

Submitted on: 2 aug. 2016

Language: C#

Type: IEnumerable<string>

Views: 5042