[VB.NET] String Replace

Joined
Aug 23, 2007
Messages
4
Reaction score
0
OK, this code is not changing everything. What's wrong with it?

Code:
Dim fileContents As String
        Dim newText As String
        fileContents = My.Computer.FileSystem.ReadAllText(path)
        newText = fileContents.Replace("23", "a").Replace("12", "b").Replace("001", "c").Replace("223", "d").Replace("7^", "e").Replace("Γ72", "f"). _
        Replace("27&", "g").Replace("$%3", "h").Replace("@#y", "i").Replace("
 
You have a problem in
Code:
filecontent.Replace()

Check this out :
Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Path As String = "D:\news.txt"
        Dim a As String = My.Computer.FileSystem.ReadAllText(Path)
        a = a.Replace("A", "B")
        My.Computer.FileSystem.WriteAllText(Path, a, False)
    End Sub
End Class
 
Back