> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Hex.trimRight

:::info
`Hex.trimRight` is a re-export of ox's [`Hex.trimRight`](https://oxlib.sh/api/Hex/trimRight). Refer to the ox documentation for the full reference.
:::

Trims trailing zeros from a [`Hex.Hex`](/docs/utilities/hex/types#hex) value.

## Imports

```ts
import { Hex } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Hex } from 'viem/utils'

Hex.trimRight('0xdeadbeef00000000')
// @log: '0xdeadbeef'
```

## Definition

```ts
function trimRight(
  value: Hex,
): trimRight.ReturnType
```

## Parameters

### value

* **Type:** `Hex`

The [`Hex.Hex`](/docs/utilities/hex/types#hex) value to trim.

## Return Type

The trimmed [`Hex.Hex`](/docs/utilities/hex/types#hex) value.

`trimRight.ReturnType`
