Files
common/docs/util/modules/_hex_stripprefix_.md
T
2018-11-10 10:42:02 +00:00

846 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:

Param Type
value string | null | undefined

Returns: string