Files
common/docs/util/modules/_hex_stripprefix_.md
T
2018-11-14 12:53:23 +00:00

39 lines
846 B
Markdown

# Functions
<a id="hexstripprefix"></a>
## hexStripPrefix
▸ **hexStripPrefix**(value: * `string` &#124; `null` &#124; `undefined`*): `string`
*Defined in [hex/stripPrefix.ts:24](https://github.com/polkadot-js/common/blob/dc07e26/packages/util/src/hex/stripPrefix.ts#L24)*
*__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__*:
```javascript
import { hexStripPrefix } from '@polkadot/util';
console.log('stripped', hexStripPrefix('0x1234')); // => 1234
```
**Parameters:**
| Param | Type |
| ------ | ------ |
| value | `string` &#124; `null` &#124; `undefined`|
**Returns:** `string`
___