I have a line of code on the server that I want to move to the client page in javascript.
string ThePhone = "1234567890";
string ThisFormat = Regex.Replace(ThePhone, @"(\d{3})(\d{3})(\d{4})", "$1-$2-$3");
It’s supposed to return 123-456-7890. How can I change this to javascript?
Thanks.
It is almost exactly the same in this case:
Notes:
/gflag (/.../g) if the string may contain more than one phone (but then we may also want\b)\din .Net matches all Unicode digits, in JavaScript it only matches[0-9].