i have contact number which i am getting from parameter which is of type String.
String pharmacyPhone = "123456789";
here i want to add - after every 3rd digit and before 4th digit
so the output will become like pharmacyPhone = 123-456-789.
so how to achieve this?