Table of Contents

Chunk Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/StringExtensions.cs

Chunk(string)

Returns a sequence that is chunked into string-slices having a length of 1024 that is equivalent to value.

public static IEnumerable<string> Chunk(this string value)

Parameters

value string

A string to chunk into a sequence of smaller string-slices for partitioned storage or similar.

Returns

IEnumerable<string>

A sequence that is chunked into string-slices having a length of 1024 that is equivalent to value.

Exceptions

ArgumentNullException

value is null.

Chunk(string, int)

Returns a sequence that is chunked into string-slices of the specified length that is equivalent to value. Default is 1024.

public static IEnumerable<string> Chunk(this string value, int length)

Parameters

value string

A string to chunk into a sequence of smaller string-slices for partitioned storage or similar.

length int

The desired length of each string-slice in the sequence.

Returns

IEnumerable<string>

A sequence that is chunked into string-slices of the specified length that is equivalent to value.

Exceptions

ArgumentNullException

value is null.

ArgumentOutOfRangeException

length is less or equal to 0.