I have a model class called PhoneNumber.cs as view model and it is being used as globally for entering the phone number. How can I restrict the user to enter 10 numeric digits only without any special character or alphabets. Also after 3 digits , it should be automatically filled up ‘-‘ when the phone number entered by the user.
PhoneNumber.cs
public string PhoneNumber {get;set}