why wont this work, I am trying to format the phone as a standard
Dim Patient = From line In System.IO.File.ReadAllLines("K:\PAT02.txt")
Select New With { _
Key .PatientID = line.substring(0,7).trim, _
.FirstName = line.substring(7,11).trim, _
.MiddleName = line.substring(18,1).trim, _
.LastName = line.substring(19,15).trim, _
.Home = (String.Format("{0:(###)###-####}", line.substring(112,10).trim)), _
}
You have an extra comma at the end of your
New Withblock, remove it and your code will compile.About your phone number problem, you’re using number formatting, so you must pass a number to the
String.Formatmethod: