Hi all
So...I am writing an app that writes notes, inserted by the user, to a txt file. The app saves that notes to a txt file, and when opening it reads the file and shows the already inserted notes.
However, I want the user to be able to delete some of those notes...but I can't seem to do it...this is what I have:
VB Code:
Dim file As New FileStream(data_path & "notes.txt", FileMode.Open) Dim text As String = Nothing Dim reader As New StreamReader(file) Dim writer As New StreamWriter(file) While Not reader.EndOfStream text = reader.ReadLine If text.Contains(value) Then text.Replace(value, "") writer.Write(text) End If End While file.Close()
*value is the string/note to be replaced
*data_path is the path I want...no problems here
It goes fine, but the text.Replace(value, "") line doesn't seem to work.
I've also tried text.Remove(0) but it doesn't removes the line...it looks like it has no effect.
Hope you guys can help me.
Thanks in advance




Reply With Quote