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
Swap the order of the operations:
if (Convert.ToInt32(ch) == 34) { Console.Write(@";"); } Console.Write(ch);
e.g. don't write the original character until AFTER you've decided to output a semicolon or not.