bytes.slice

bytes.slice

bytes.slice

Function

Intercept the byte range of Bytes and return new Bytes.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
startIntNo0Starting index, including this position. Supports counting negative numbers from the tail.
endIntNoLength in bytesEnd index, excluding this position. Supports counting negative numbers from the tail.

Return value

TypeDescription
BytesNew Bytes after interception.

Code Example

Notes

  • Returns empty Bytes when start >= end.