étant débutante je ne crois pas que ceci marche
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionImports System Imports System.IO Public Class Test Public Shared Sub Main() Dim path As String = "c:\temp\MyTest.txt" Dim sw As StreamWriter ' This text is added only once to the file. If File.Exists(path) = False Then ' Create a file to write to. Dim createText() As String = {"Hello", "And", "Welcome"} File.WriteAllLines(path, createText) End If ' This text is always added, making the file longer over time ' if it is not deleted. Dim appendText As String = "This is extra text" + Environment.NewLine File.AppendAllText(path, appendText) ' Open the file to read from. Dim readText() As String = File.ReadAllLines(path) Dim s As String For Each s In readText Console.WriteLine(s) Next End Sub End Class
Imports System Imports System.IO ...... 'LIRE Dim lines As String() = File.ReadAllLines(filename, System.Text.Encoding.Default) 'TRANSFORMER Dim L2 As New List(Of String) For Each s In lines.ToList L2.Add(Replace(s, "", "") Next 'SAUVEGARDER File.WriteAllLines(NewFilename , L2.ToArray)