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

881 B

Functions

stringShorten

▸ stringShorten(_value: any, prefixLength?: number): string

Defined in string/shorten.ts:20

name: stringShorten

signature: stringShorten (value: any, prefixLength: number = 8): string

summary: Returns a string with maximum length

description: Checks the string against the prefixLength, if longer than dopuble this, shortens it by placing .. in the middle of it

example:

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

stringShorten('1234567890', 2); // => 12..90

Parameters:

Param Type Default value
_value any -
Default value prefixLength number 6

Returns: string