Skip to main content
Version: 3.0.8

Humanizer.ICollectionFormatter

ICollectionFormatter Interface

An interface you should implement to localize Humanize for collections

public interface ICollectionFormatter

Methods

ICollectionFormatter.Humanize<T>(IEnumerable<T>) Method

Formats the collection for display, calling ToString() on each object.

string Humanize<T>(System.Collections.Generic.IEnumerable<T> collection);

Type parameters

T

Parameters

collection System.Collections.Generic.IEnumerable<T>

Returns

System.String

ICollectionFormatter.Humanize<T>(IEnumerable<T>, string) Method

Formats the collection for display, calling ToString() on each object and using separator before the final item.

string Humanize<T>(System.Collections.Generic.IEnumerable<T> collection, string separator);

Type parameters

T

Parameters

collection System.Collections.Generic.IEnumerable<T>

separator System.String

Returns

System.String

ICollectionFormatter.Humanize<T>(IEnumerable<T>, Func<T,object>) Method

Formats the collection for display, calling objectFormatter on each element.

string Humanize<T>(System.Collections.Generic.IEnumerable<T> collection, System.Func<T,object?> objectFormatter);

Type parameters

T

Parameters

collection System.Collections.Generic.IEnumerable<T>

objectFormatter System.Func<T,System.Object>

Returns

System.String

ICollectionFormatter.Humanize<T>(IEnumerable<T>, Func<T,object>, string) Method

Formats the collection for display, calling objectFormatter on each element. and using separator before the final item.

string Humanize<T>(System.Collections.Generic.IEnumerable<T> collection, System.Func<T,object?> objectFormatter, string separator);

Type parameters

T

Parameters

collection System.Collections.Generic.IEnumerable<T>

objectFormatter System.Func<T,System.Object>

separator System.String

Returns

System.String

ICollectionFormatter.Humanize<T>(IEnumerable<T>, Func<T,string>) Method

Formats the collection for display, calling objectFormatter on each element.

string Humanize<T>(System.Collections.Generic.IEnumerable<T> collection, System.Func<T,string?> objectFormatter);

Type parameters

T

Parameters

collection System.Collections.Generic.IEnumerable<T>

objectFormatter System.Func<T,System.String>

Returns

System.String

ICollectionFormatter.Humanize<T>(IEnumerable<T>, Func<T,string>, string) Method

Formats the collection for display, calling objectFormatter on each element. and using separator before the final item.

string Humanize<T>(System.Collections.Generic.IEnumerable<T> collection, System.Func<T,string?> objectFormatter, string separator);

Type parameters

T

Parameters

collection System.Collections.Generic.IEnumerable<T>

objectFormatter System.Func<T,System.String>

separator System.String

Returns

System.String