Home Reference Source
public class | source

StringMask

NumberMask

A javascript implementation for BBj numbers masking

Static Method Summary

Static Public Methods
public static

mask(str: String, mask: String, loose: Boolean): String

Mask the given string with the given mask according to BBj rules

Static Public Methods

public static mask(str: String, mask: String, loose: Boolean): String source

Mask the given string with the given mask according to BBj rules

Params:

NameTypeAttributeDescription
str String

the string to mask

mask String

the mask to use for formatting

loose Boolean
  • optional
  • default: true

when true , errors will be ignored and the method will try at apply the mask anyway , otherwise it will stop at first error and throw it.

Return:

String

the masked string

Throw:

MaskIsTooShortError

StringMaskError

MaskError