string formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
how do i take a string like "123456789"
and format it like this: "123-45-6789"

thanks,
rodchar
 
how do i take a string like "123456789"
and format it like this: "123-45-6789"

Should be something like Format$("123456789", "###-##-####")

Note that if this is a SSN it is a string, not a number.
 
hey all,
how do i take a string like "123456789"
and format it like this: "123-45-6789"

Dim S As String = "123456789"
If Len(S) = 9 Then S = Mid(S, 1, 3) & "-" & Mid(S, 4, 2) & "-" & Mid(S, 6,
4)
 
Back
Top