> For the complete documentation index, see [llms.txt](https://gabriel-schade-cardoso.gitbook.io/tango/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gabriel-schade-cardoso.gitbook.io/tango/modules/collection/concat.md).

# Concat

Returns a new collection that contains the elements of each the collection in order.

| Parameters                            | Returns         |
| ------------------------------------- | --------------- |
| IEnumerable\<IEnumerable\<T>> sources | IEnumerable\<T> |
| params IEnumerable\<T>\[ ] sources    | IEnumerable\<T> |

## Usage

There's two different overloads of this function, but they works in a very similar way.

The first one requires that the parameter is an `IEnumerable` of `IEnumerables` and the second one uses the `params` keyword to provides a way to inform multiples standalone `IEnumerables`.

&#x20;**Concatenating an IEnumerable of IEnumerabls**&#x20;

```csharp
//IEnumerable<IEnumerable<int>> sources = 
//    { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 } }

IEnumerable<int> result = sources.Concat()

//result = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
```

&#x20;**Concatenating three different collections**&#x20;

```csharp
//IEnumerable<int> first = { 6, 7, 8, 9, 10 }
//IEnumerable<int> second = { 1, 2, 3, 4, 5 }
//IEnumerable<int> third = { 2, 4, 6, 8, 10 }

IEnumerable<int> result = first.Concat(second, third);

//result = { 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 2, 4, 6, 8, 10 }
```
