All Genesis.* projects are formalizations of small pieces of functionality I find myself copying from project to project. Some are small to the point of triviality, but are time-savers nonetheless. They have a particular focus on performance with respect to mobile development, but are certainly applicable outside this domain.
Genesis.Join adds a convenient Join
extension method to IEnumerable<string>
, allowing an enumerable of strings to be joined together with a configurable separator. It is delivered as a PCL targeting a wide range of platforms, including:
- .NET 4.5
- Windows 8
- Windows Store
- Windows Phone 8
- Xamarin iOS
- Xamarin Android
Joining strings in an enumerable is something I find myself needing to do quite often. When performed within a LINQ pipeline, it's more elegant and simpler to read using an extension method than using string.Join
directly.
The easiest way to get Genesis.Join is via NuGet:
Install-Package Genesis.Join
You can simply call Join
against any IEnumerable<string>
:
var customerNames = this
.customers
.Select(customer => customer.Name)
.Join(", ");
Genesis.Join is created and maintained by Kent Boogaart. Issues and pull requests are welcome.