I need to run through various text files replacing certain text with other text. I need to open the file then run through a lengthy list of words that need to be changed, searching and replacing as necessary.
My first thought was to open the text file, bring the whole thing into one string variable then execute a Replace for each of the words in my list. Since I've got to go through an extensive list of possibly large files, I'm wondering if the RegExp's Replace method might perform better. Also, is there a practical limit to the size of the string upon which Replace or RegExp.Replace will operate?
My first thought was to open the text file, bring the whole thing into one string variable then execute a Replace for each of the words in my list. Since I've got to go through an extensive list of possibly large files, I'm wondering if the RegExp's Replace method might perform better. Also, is there a practical limit to the size of the string upon which Replace or RegExp.Replace will operate?