Files
common/docs/util/modules/_hex_stripprefix_.md
T
2018-12-21 09:08:40 +00:00

845 B

Functions

hexStripPrefix

▸ hexStripPrefix(value: * string | null | undefined*): string

Defined in hex/stripPrefix.ts:24

name: hexStripPrefix

signature: hexStripPrefix (value: ?string): string

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
value string | null | undefined

Returns: string