Skip to content

maskText

Function | Source Code


maskText(text: string, mask: RegExp): string


Masks text on a per-character basis.

The masked text.

maskText('abc123', /\d/); // => '123'

The text to mask.


The mask to apply to the text. The mask will be applied on a per-character basis.