Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Dim newLines = From line In File.ReadAllLines(path)
  2. Where Not line.StartsWith("{TAM98}")
  3. File.WriteAllLines(path, newLines)
  4.  
  5. Dim sb As New System.Text.StringBuilder()
  6. Dim myFilePath As String = "c:MyFile.txt"
  7. Dim mySearchToken As String = "{TAM98}"
  8.  
  9. For Each line As String In System.IO.File.ReadLines(myFilePath)
  10. If (String.Compare(Left(line, mySearchToken.Length), mySearchToken, True) <> 0) Then sb.AppendLine(line)
  11. Next
  12.  
  13. System.IO.File.WriteAllText(myFilePath, sb.ToString())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement