How can I speed things up

This literally took 15 minutes to complete for 200k lines of text:

 string[] oldArray = textBox1.Text.Trim('r').Split('n'); textBox1.Clear(); int r = 0; for (int s = 0; s < oldArray.Length; s++) { if (oldArray[s].Contains("mdm")) { oldArray[s] = ""; } textBox1.Text = textBox1.Text + oldArray[s] + "n"; 

I have tried using StringReader but the endless while wouldn’t stop when I used a failsafe at the end of the file. I placed !Done! and in my code I used While(true) if (line != “!Done”) and it went Foooorever =. But the code I used above works perfect, its just takes too damn long.

submitted by /u/dattyGiraffe
[link] [comments]

Leave a Reply