> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# dataSlice

```ts theme={null}
function dataSlice(
   data, 
   start?, 
   end?): string
```

Returns a DataHexString | **DataHexString** by slicing `data` from the `start` offset to the `end` offset.

By default `start` is 0 and `end` is the length of `data`.

## Parameters

| Parameter | Type                                               | Description        |
| :-------- | :------------------------------------------------- | :----------------- |
| `data`    | [`BytesLike`](/sdk/content/type-aliases/BytesLike) | The data to slice. |
| `start`?  | `number`                                           | The start offset.  |
| `end`?    | `number`                                           | The end offset.    |

## Returns

`string`

The sliced data.

## Throws

If the end offset is beyond the data bounds.

## Source

[utils/data.ts:182](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/utils/data.ts#L182)
