# Bytes.slice

Returns a section of a [`Bytes.Bytes`](/api/Bytes/types#bytes) value given a start/end bytes offset.

## Imports

:::code-group
```ts [Named]
import { Bytes } from 'ox'
```

```ts [Entrypoint]
import * as Bytes from 'ox/Bytes'
```
:::

## Examples

```ts twoslash
import { Bytes } from 'ox'

Bytes.slice(Bytes.from([1, 2, 3, 4, 5, 6, 7, 8, 9]), 1, 4)
// @log: Uint8Array([2, 3, 4])
```

## Definition

```ts
function slice(
  value: Bytes,
  start?: number,
  end?: number,
  options?: slice.Options,
): Bytes
```

**Source:** [src/core/Bytes.ts](https://github.com/wevm/ox/blob/main/src/core/Bytes.ts#L890)

## Parameters

### value

* **Type:** `Bytes`

The [`Bytes.Bytes`](/api/Bytes/types#bytes) value.

### start

* **Type:** `number`
* **Optional**

Start offset.

### end

* **Type:** `number`
* **Optional**

End offset.

### options

* **Type:** `slice.Options`
* **Optional**

Slice options.

#### options.strict

* **Type:** `boolean`
* **Optional**

Asserts that the sliced value is the same size as the given start/end offsets.

## Return Type

Sliced [`Bytes.Bytes`](/api/Bytes/types#bytes) value.

`Bytes`
