hi all,
I am having a notepad file which is having some fields which is seperated by space just like below
aaa bbbb
aaa ccc
i want to upload each field to the database when the user click the upload button,it is working but the problem is that since i am using the space as delimiter ,if there are more than one space it is just taking the second and the fooling spaces into the array here the code i am using can anybody tell me a better options for dooig this
dim userPostedFile As HttpPostedFile = FileUpload1.Pos tedFile
Dim fp As StreamReader
Dim fileContents As String = " "
fp = File.OpenText(u serPostedFile.F ileName)
fileContents = fp.ReadToEnd()
Dim arrayOfStrings( ) As String = fileContents.Sp lit(" ")
pls help me in the above matter
I am having a notepad file which is having some fields which is seperated by space just like below
aaa bbbb
aaa ccc
i want to upload each field to the database when the user click the upload button,it is working but the problem is that since i am using the space as delimiter ,if there are more than one space it is just taking the second and the fooling spaces into the array here the code i am using can anybody tell me a better options for dooig this
dim userPostedFile As HttpPostedFile = FileUpload1.Pos tedFile
Dim fp As StreamReader
Dim fileContents As String = " "
fp = File.OpenText(u serPostedFile.F ileName)
fileContents = fp.ReadToEnd()
Dim arrayOfStrings( ) As String = fileContents.Sp lit(" ")
pls help me in the above matter
Comment