string manipulation for phone numbers
-
I would like to be able to accept phone numbers in various formats: 800-555-1212 800.555.1212 (800) 555-1212 (800)555-1212 and then format it to this: 800-555-1212 i created a function which strips out characters: ()- so now my number is: 8005551212 but how can i put the "-" back in there to make it 800-555-1212 ? thanks in advance!
-
I would like to be able to accept phone numbers in various formats: 800-555-1212 800.555.1212 (800) 555-1212 (800)555-1212 and then format it to this: 800-555-1212 i created a function which strips out characters: ()- so now my number is: 8005551212 but how can i put the "-" back in there to make it 800-555-1212 ? thanks in advance!
Check out the
String.Insert()
method.... --------------------------- Hmmm... what's a signature? -
I would like to be able to accept phone numbers in various formats: 800-555-1212 800.555.1212 (800) 555-1212 (800)555-1212 and then format it to this: 800-555-1212 i created a function which strips out characters: ()- so now my number is: 8005551212 but how can i put the "-" back in there to make it 800-555-1212 ? thanks in advance!