I have a string value 1233873600 in C# and I have to convert it to 123-387-7300 in C#
Is there any in-built function which will do that in c#?
Cast your string to a long and use the format "{0:### ### ####}"
;
string.Format("{0:(###) ###-####}", 1112223333);
string phone = "1233873600".Insert(6, "-").Insert(3, "-");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With