mask

Overview

Returns the masked value of the given value.

Arguments

string val

Value to be masked. Required.

number start

Start character position to mask. If not specified, 1 is used.

number end

End character position to mask. If not specified, 1 is used.

string separator

Separator to split value as multiple words.

string ignore

Characters to ignore when masking.

Return Value

Masked value

Remarks


Examples

mask('Hello Word') -> 'H*********d'
mask('Hello World',2,1,' ') ->  He**o Wo**d
mask('1234-5678-9012-3456',4,4,'','-')   ->  1234-****-****-3456


See Also


Copyright © 2010 - 2023 Emakin. All rights reserved.