How is it possible to optimize this code segment in general?

string[] str = { solution, answer }; richTextBox1.Lines = str; richTextBox1.Select(0, str[0].Length); richTextBox1.SelectionColor = Properties.Settings.Default.FontColor; richTextBox1.Select(str[0].Length, str[1].Length + 1); richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); 
  • And what confuses you in this code? - andreycha
  • 2
    @andreycha, for example, I am confused by the use of str[0] , str[1] when you could use the solution , answer :) - Grundy
  • And what a magic +1 in the penultimate line? I guess, but if I'm right, it's better to do it a little differently. What is the optimization required? - rdorn
  • 3
    And what kind of optimization are you interested in? What is wrong and what measurable effect do you want to achieve? - VladD

0