Files
common/docs/util/modules/_hex_stripprefix_.md
T
2019-01-11 10:55:22 +00:00

824 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

Returns: string