Files
common/docs/util/modules/_hex_stripprefix_.md
T
2019-02-22 11:37:23 +00:00

752 B

Functions

hexStripPrefix

▸ hexStripPrefix(value?: string | null): string

Defined in hex/stripPrefix.ts:23

name: hexStripPrefix

summary: Strips any leading 0x prefix.

description: Tests for the existence of a 0x prefix, and returns the value without the prefix. Un-prefixed values are returned as-is.

example:

import { hexStripPrefix } from '@polkadot/util';

console.log('stripped', hexStripPrefix('0x1234')); // => 1234

Parameters:

Name Type
Optional value string | null

Returns: string