I have an NSString that holds something like this:
4434332124
How can I make that into something like this?
443-433-2124
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This can be done in only two lines just use NSString’s stringWithFormat method and chop up the phone number into individual substrings and glue the whole thing together in your format string. Something like this:
EDIT: Working Code