索引值是跟顺序查找时一样,从文本开头开始的么?
怎么每次查找都是只能找到文本最后那个符合的字符串?
谢谢啦。
怎么每次查找都是只能找到文本最后那个符合的字符串?
谢谢啦。
解决方案 »
- 怎样根据指定的数量来保留xml文件前若干个子节点
- winform 通过反射执行方法
- c# 按位求补运算符
- c# DataGrid分页报错---很奇怪-----晕
- datagrid绑定到从表,如何使他只能修改,不能删除
- ScrollBar问题 VScrollBar或HScrollBar?欢迎讨论!!!
- C# 动态创建 如何动态调用
- 如何做winform中button的动态移动功能
- 请问VS.Net中,“我最近的文件”“我最近的项目”那种菜单是如何作出来的?
- 异步下载zip文件DownloadProgressChanged的TotalBytesToReceive一直是-1,怎么解决?
- 单位转换问题,耐心求解!!
- C#(asp.net)连接sqlserver 怪异的问题
{
this.richTextBox1.SelectionColor = this.richTextBox1.ForeColor;
string str = "b";
if (lastIndex == -1)
{
lastIndex = this.richTextBox1.Text.Length - 1;
}
lastIndex = this.richTextBox1.Find(str, 0, lastIndex, RichTextBoxFinds.Reverse);
if (lastIndex != -1)
{
this.richTextBox1.SelectionStart = lastIndex;
this.richTextBox1.SelectionLength = str.Length;
}
this.richTextBox1.SelectionColor = Color.Red;
}
{
this.richTextBox1.SelectionColor = this.richTextBox1.ForeColor;
string str = "b";
if (lastIndex + 1 == this.richTextBox1.Text.Length)
{
lastIndex = -1;
}
lastIndex = this.richTextBox1.Find(str, lastIndex + 1, this.richTextBox1.Text.Length - 1, RichTextBoxFinds.None);
if (lastIndex != -1)
{
this.richTextBox1.SelectionStart = lastIndex;
this.richTextBox1.SelectionLength = str.Length;
}
this.richTextBox1.SelectionColor = Color.Red;
}
下次要记得放分