>I have no idea how big your string is, but I can see how a large enough string might eat up memory. Perhaps you can have an overloaded CreateFileEncoding() method that takes a StringBuilder instead of a string. That way, you don't utilize .ToString() until you're in the process of actually writing it out to a file
>
>
>loStreamWriter.Write(tcStringBuilder.ToString())
>
>
>Would that work ok for you?
This is a great idea. I will work on it and let you know.