Can i get unmasked user input ?
given:
let mask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
masked value after user input:
(555) 123-4567
what i would like to get:
5551234567
Just use a regex to wipe out unwanted chars.
@refo
let onlyNumbers = userInput.replace(/\D/g, '');
Thank you guys. I was wondering if the library collects each char separately as user inputs and the char conformed to mask. For some reason, it didn't occur to me that unmasked values may vary for different masks : )
馃憤
Guys, if i mask the number with *, and then if i do a unmask, how do i get orignal value ?
thanks in advance!!!
+1
Most helpful comment
@refo