I’m making an XNA game console which should draw the output lines as they are added. I want to draw only the last 10 lines and I can’t figure out how to produce the actual output string.
I was trying to use StringBuilder to collect all lines in it and then read the last lines into a String, but it turns out StringBuilder doesn’t have a specific line retrieval method. I tried using String[], but it adds significant lag increasing over time. How should I do this?
If you no longer need messages older than 10 lines, you could use a typed Queue.
Depending on how you’re rendering it, it might be the easiest way of managing that data.