Skip to content

Instantly share code, notes, and snippets.

@haeky
Created June 27, 2013 15:23
Show Gist options
  • Save haeky/5877379 to your computer and use it in GitHub Desktop.
Save haeky/5877379 to your computer and use it in GitHub Desktop.
Example of a StreamReader/StreamWriter in C# to modify a specific line.
using (StreamWriter wStreamWriter = new StreamWriter(wPathTarget))
{
using (StreamReader wStreamReader = new StreamReader(wPathSource))
{
while ((wLine = wStreamReader.ReadLine()) != null)
{
if (!wLine.Contains(iPackageName))
{
wStreamWriter.WriteLine(wLine);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment