Advertisement

How to speedily parse 26,000 lines to (rich)textbox in C#

How to speedily parse 26,000 lines to (rich)textbox in C# I encountered this by accident, not sure how commonly known this solution is. But it works. 26,000 lines of entries in about 1 second using a single core of my cheap laptop's CPU. Not sure if this works in regular textbox.

After finishing the video, I copied the 26,000 lines into Notepad and it also took about 1 second to process. I suspect TED Notepad is doing something with additional cores or is doing what I done for my Gamemaker program: loading relevant text for the location of the scrollbar.

'string[] lines = new string[datasort.Count+1];' is not correct. The +1 was added because I tried shifting down the output to get the timer in the textbox, but forgot to put it back to 'string[] lines = new string[datasort.Count];' after I created a new text box for it.

(rich)textbox

Post a Comment

0 Comments