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

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -