I'm presuming that the reason for the question is how do you replace a character in a string at a certain position and that you are ok with file io.
You will need to read from one file and write to another (and after you have finished then delete the original file and rename the new file if necessary)
As you read in each line then assuming the initial value of the line is in s and you want to replace the character at position 20 with A then:
Dim s As String = "123456789012345678901234567890"
MessageBox.Show(s)
s = s.Remove(19, 1).Insert(19, "A")
MessageBox.Show(s)
so reading a file you woulkd use s = sr.ReadLine and after processing sw.WriteLine(s)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.