Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何实现“查找下一个”功能?我有一种方法可以集体提供搜索结果,但我想实现“查找下一个”功能,我想从顶部逐个查找所需的搜索文本。单击按钮将显示第一次出现,第二次单击将显示第二次出现。
试试这样
int lastindex = 0; string str = "cd ce ce cesd cd sd cd"; str.IndexOf("cd", lastindex + 1);