Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 728 Bytes

File metadata and controls

28 lines (22 loc) · 728 Bytes

IEnumerable.Append

An IEnumerable extension that allows a single item to be concatenated to an existing enumerable collection. Microsoft added an Append method in the System.Linq namespace from .NET Framework 4.7.1. Use this package to get the same functionality in early versions.

Example

using System;
using System.Collections.Generic;
using IEnumerable.Append;

namespace Example
{
    public class Program
    {
        public static void Main(string[] args)
        {
            IEnumerable<string> input = new [] { "Lorem", "ipsum", "dolor", "sit" };

            IEnumerable<string> output = input.Append("amet");

            Console.WriteLine(string.Join(" ", output)); 
        }
    }
}