# Utils.EnumerableToString(IEnumerable&lt;T&gt;, Func&lt;T, string&gt;, string, bool)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.utils/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.utils/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Utils/Utils.cs#L29-L65)

```csharp
public static string EnumerableToString<T>(IEnumerable<T>? collection, Func<T, string>? toString = null, string separator = ", ", bool putInBrackets = true)
```

Returns a human-readable text string that describes an IEnumerable collection of objects.

### Parameters

- `collection` (`IEnumerable<T>`): The IEnumerable to describe.
- `toString` (`Func<T, string>`): Converts the element to a string. If none specified, `System.Object.ToString` will be used.
- `separator` (`string`): The separator to use.
- `putInBrackets` (`bool`): Puts elements within brackets

### Returns

A string assembled by wrapping the string descriptions of the individual elements with square brackets and separating them with commas.
