Method Split
View SourceSplit<TSource>(IAsyncEnumerable<TSource>, TSource)
Splits the source sequence by a separator.
Declaration
public static IAsyncEnumerable<IReadOnlyList<TSource>> Split<TSource>(this IAsyncEnumerable<TSource> source, TSource separator)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyList<TSource>> | A sequence of splits of elements. |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Split<TSource>(IAsyncEnumerable<TSource>, TSource, int)
Splits the source sequence by a separator given a maximum count of splits.
Declaration
public static IAsyncEnumerable<IReadOnlyList<TSource>> Split<TSource>(this IAsyncEnumerable<TSource> source, TSource separator, int count)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
int | count | Maximum number of splits. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyList<TSource>> | A sequence of splits of elements. |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Split<TSource, TResult>(IAsyncEnumerable<TSource>, TSource, Func<IReadOnlyList<TSource>, TResult>)
Splits the source sequence by a separator and then transforms the splits into results.
Declaration
public static IAsyncEnumerable<TResult> Split<TSource, TResult>(this IAsyncEnumerable<TSource> source, TSource separator, Func<IReadOnlyList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
Func<IReadOnlyList<TSource>, TResult> | resultSelector | Function used to project splits of source elements into elements of the resulting sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of values typed as |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
TResult | Type of the result sequence elements. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
Split<TSource, TResult>(IAsyncEnumerable<TSource>, TSource, int, Func<IReadOnlyList<TSource>, TResult>)
Splits the source sequence by a separator, given a maximum count of splits, and then transforms the splits into results.
Declaration
public static IAsyncEnumerable<TResult> Split<TSource, TResult>(this IAsyncEnumerable<TSource> source, TSource separator, int count, Func<IReadOnlyList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
int | count | Maximum number of splits. |
Func<IReadOnlyList<TSource>, TResult> | resultSelector | Function used to project splits of source elements into elements of the resulting sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of values typed as |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
TResult | Type of the result sequence elements. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Split<TSource>(IAsyncEnumerable<TSource>, TSource, IEqualityComparer<TSource>?)
Splits the source sequence by a separator and then transforms the splits into results.
Declaration
public static IAsyncEnumerable<IReadOnlyList<TSource>> Split<TSource>(this IAsyncEnumerable<TSource> source, TSource separator, IEqualityComparer<TSource>? comparer)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
IEqualityComparer<TSource> | comparer | Comparer used to determine separator element equality. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyList<TSource>> | A sequence of splits of elements. |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Split<TSource>(IAsyncEnumerable<TSource>, TSource, IEqualityComparer<TSource>?, int)
Splits the source sequence by a separator, given a maximum count of splits. A parameter specifies how the separator is compared for equality.
Declaration
public static IAsyncEnumerable<IReadOnlyList<TSource>> Split<TSource>(this IAsyncEnumerable<TSource> source, TSource separator, IEqualityComparer<TSource>? comparer, int count)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
IEqualityComparer<TSource> | comparer | Comparer used to determine separator element equality. |
int | count | Maximum number of splits. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyList<TSource>> | A sequence of splits of elements. |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Split<TSource, TResult>(IAsyncEnumerable<TSource>, TSource, IEqualityComparer<TSource>, Func<IReadOnlyList<TSource>, TResult>)
Splits the source sequence by a separator and then transforms the splits into results. A parameter specifies how the separator is compared for equality.
Declaration
public static IAsyncEnumerable<TResult> Split<TSource, TResult>(this IAsyncEnumerable<TSource> source, TSource separator, IEqualityComparer<TSource> comparer, Func<IReadOnlyList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
IEqualityComparer<TSource> | comparer | Comparer used to determine separator element equality. |
Func<IReadOnlyList<TSource>, TResult> | resultSelector | Function used to project splits of source elements into elements of the resulting sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of values typed as |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
TResult | Type of the result sequence elements. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
Split<TSource, TResult>(IAsyncEnumerable<TSource>, TSource, IEqualityComparer<TSource>?, int, Func<IReadOnlyList<TSource>, TResult>)
Splits the source sequence by a separator, given a maximum count of splits, and then transforms the splits into results. A parameter specifies how the separator is compared for equality.
Declaration
public static IAsyncEnumerable<TResult> Split<TSource, TResult>(this IAsyncEnumerable<TSource> source, TSource separator, IEqualityComparer<TSource>? comparer, int count, Func<IReadOnlyList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
TSource | separator | Separator element. |
IEqualityComparer<TSource> | comparer | Comparer used to determine separator element equality. |
int | count | Maximum number of splits. |
Func<IReadOnlyList<TSource>, TResult> | resultSelector | Function used to project splits of source elements into elements of the resulting sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of values typed as |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
TResult | Type of the result sequence elements. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Split<TSource>(IAsyncEnumerable<TSource>, Func<TSource, bool>)
Splits the source sequence by separator elements identified by a function.
Declaration
public static IAsyncEnumerable<IReadOnlyList<TSource>> Split<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> separatorFunc)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
Func<TSource, bool> | separatorFunc | Predicate function used to determine the splitter elements in the source sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyList<TSource>> | A sequence of splits of elements. |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
Split<TSource>(IAsyncEnumerable<TSource>, Func<TSource, bool>, int)
Splits the source sequence by separator elements identified by a function, given a maximum count of splits.
Declaration
public static IAsyncEnumerable<IReadOnlyList<TSource>> Split<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> separatorFunc, int count)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
Func<TSource, bool> | separatorFunc | Predicate function used to determine the splitter elements in the source sequence. |
int | count | Maximum number of splits. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyList<TSource>> | A sequence of splits of elements. |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Split<TSource, TResult>(IAsyncEnumerable<TSource>, Func<TSource, bool>, Func<IReadOnlyList<TSource>, TResult>)
Splits the source sequence by separator elements identified by a function and then transforms the splits into results.
Declaration
public static IAsyncEnumerable<TResult> Split<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> separatorFunc, Func<IReadOnlyList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
Func<TSource, bool> | separatorFunc | Predicate function used to determine the splitter elements in the source sequence. |
Func<IReadOnlyList<TSource>, TResult> | resultSelector | Function used to project splits of source elements into elements of the resulting sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of values typed as |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
TResult | Type of the result sequence elements. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
ArgumentNullException |
|
Split<TSource, TResult>(IAsyncEnumerable<TSource>, Func<TSource, bool>, int, Func<IReadOnlyList<TSource>, TResult>)
Splits the source sequence by separator elements identified by a function, given a maximum count of splits, and then transforms the splits into results.
Declaration
public static IAsyncEnumerable<TResult> Split<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> separatorFunc, int count, Func<IReadOnlyList<TSource>, TResult> resultSelector)
Parameters
Type | Name | Description |
---|---|---|
IAsyncEnumerable<TSource> | source | The source sequence. |
Func<TSource, bool> | separatorFunc | Predicate function used to determine the splitter elements in the source sequence. |
int | count | Maximum number of splits. |
Func<IReadOnlyList<TSource>, TResult> | resultSelector | Function used to project a split group of source elements into an element of the resulting sequence. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<TResult> | A sequence of values typed as |
Type Parameters
Name | Description |
---|---|
TSource | Type of element in the source sequence. |
TResult | Type of the result sequence elements. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentNullException |
|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|