# Hex.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 { Hex } from 'ox'
```

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

## Examples

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

Hex.slice('0x0123456789', 1, 4)
// @log: '0x234567'
```

## Definition

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

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

## Parameters

### value

* **Type:** `Hex`

The [`Hex.Hex`](/api/Hex/types#hex) value to slice.

### start

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

The start offset (in bytes).

### end

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

The end offset (in bytes).

### options

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

Options.

#### options.strict

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

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

## Return Type

The sliced [`Hex.Hex`](/api/Hex/types#hex) value.

`Hex`
