CastArrayTFrom, TToSlice(Int32) Method
Gets a new
CastArrayTFrom, TTo instance, which represents a subsection of the current instance with the specified
startIndex.
Please note that the size of
TTo multiplied by
startIndex must be divisible by the size of
TFrom.
Namespace: KGySoft.CollectionsAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public CastArray<TFrom, TTo> Slice(
int startIndex
)
Public Function Slice (
startIndex As Integer
) As CastArray(Of TFrom, TTo)
public:
CastArray<TFrom, TTo> Slice(
int startIndex
)
member Slice :
startIndex : int -> CastArray<'TFrom, 'TTo>
- startIndex Int32
- The offset that points to the first item of the returned section.
CastArrayTFrom,
TToThe subsection of the current
CastArrayTFrom, TTo instance with the specified
startIndex.
If the size of
TTo multiplied by
startIndex is not divisible by the size of
TFrom,
then this method throws an
ArgumentException. If the targeted platform supports the
SpanT type and misaligned memory access,
then you can try to use the
AsSpan property and the
MemoryMarshal.Cast method.