string question
Hi , I need to insert a "-" character into a nine digit number ( a social security number ) . Anyone know the best way to do this ? basically I need to take :
xxxxxxxxx and make it : xxx-xx-xxxx
[198 byte] By [
Matrix.net] at [2007-11-11 10:21:03]

# 1 Re: string question
If it's actually a number, you can do this:
Dim SSN As String = Format(123456789, "###-##-####")
If it's a nine-character string (e.g., "123456789"), you can do this:
Dim SSN As String = "123456789"
SSN = SSN.Insert(3, "-")
SSN = SSN.Insert(6, "-")