C
cj2
While I'm learning about format, will it work with strings?
I want to take this string
dim thisCustNo as string = "9128764526"
and make it look like
(912)876-4526
I found I can do this
thisCustNo.Format("({0}){1}-{2}",thisCustNo.Substring(0,3),thisCustNo.Substring(3,3),thisCustNo.Substring(6,4))
But for me that isn't a bit easier or clearer or nicer than
"("+thisCustNo.Substring(0,3)+")"+thisCustNo.Substring(3,3)+"-"+thisCustNo.Substring(6,4)
Am I missing something?
I want to take this string
dim thisCustNo as string = "9128764526"
and make it look like
(912)876-4526
I found I can do this
thisCustNo.Format("({0}){1}-{2}",thisCustNo.Substring(0,3),thisCustNo.Substring(3,3),thisCustNo.Substring(6,4))
But for me that isn't a bit easier or clearer or nicer than
"("+thisCustNo.Substring(0,3)+")"+thisCustNo.Substring(3,3)+"-"+thisCustNo.Substring(6,4)
Am I missing something?