Format a Social Security Number (SSN) as XXX-XX-XXXX from XXXXXXXXX
For a simple, short, and self commenting solution, try:
String.Format("{0:000-00-0000}", 123456789)
123456789
representing your SSN variable.
Check out the String.Insert method.
string formattedSSN = unformattedSSN.Insert(5, "-").Insert(3, "-");