for (int i = 0; i < types.Count; i++)
{
     string name = getTypeName(types[i]);     string sss = output.Substring(recog[i], name.Length + 1);     richTextBox1.SelectionStart = recog[i];
     richTextBox1.SelectionLength = name.Length + 1;
     richTextBox1.SelectionColor = Color.Red;
     richTextBox1.SelectionBackColor = Color.Yellow;
}我想给richTextBox1里的文本背景加上颜色,代码如上,结果从第二回循环开始
位置就错乱了,
我特别加入string sss = output.Substring(recog[i], name.Length + 1);这么一句话,
截取到的sss的值是正确的,下面richTextBox1也是按照同样位置截取的,为什么和sss
不是一样的位置???