How to transfer phones of the form +79033838833 to the view +7 (930) 383-88-33?
- and if Belarus, for example, there is something like +385 999 ... - splash58
- github.com/googlei18n/libphonenumber - etki
- mdn replace - Grundy
- so it seems like the regular schedule that you were offered in another similar question ru.stackoverflow.com/a/750697/191482 ...... why the algorithm? Or do you want to write some more code? - Alexey Shimansky
- What prevents to write such an algorithm? - Drakonoved
|
2 answers
Very approximately through the replacement of the regular season:
var tel = '+79031559499'; var tel = tel.replace(/\+7(\d{3})(\d{3})(\d{2})(\d{2})/, '+7 ($1) $2-$3-$4'); console.log(tel); PS And it is not clear that this in your question one phone number has changed into a completely different one.
- corrected. this is for example. just need to convert this mask - werty
|
jQuery(function($){$("#phone").mask("(999) 999-9999");}); Use the script mask for the number - link
- oneAnd jQuery wasn't actually asked. - Qwertiy ♦
|