I want my program to read a text file all characters 1 by 1 and whereever it finds inverted comma ( \" ), it adds a semicolon before that inverted comma. For eg we have a pa
Do you have to read in character by character? The following code will do the whole thing as a block and return you a list containing all your lines.
var contents = File.ReadAllLines (@"C:\Users\user1\Documents\data.txt") .Select (l => l.Replace ("\"", ";\""));