C#: Replacement of $REPLACE_ID$ tokens (file or stream input+output)

Helped out a guy on IRC making a method that replaces text in a file/stream, thought I’d share it. Basically it reads from one file line by line and writes to another while executing a custom replacement method on every line.

Note: This code is not optimized for speed. Although it will perform very well, it CAN be optimized a lot. This is meant as coder friendly code. However it will not use more memory when processing large files.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: