vb.net - Write to a specific line in txt file when the line is empty -
i working on file writing in vb.net. know how override specific line in text file when empty or equal "" , fails.
i tried with
dim lines() string = system.io.file.readalllines("filepath") lines(4) = "to replace text" system.io.file.writealllines(filepath, lines)
it shows index out of array exception. might because line in file empty.
thank you
Comments
Post a Comment