| |

VerySource

 Forgot password?
 Register
Search
Author: solhjx

Experts invited, thank you very much for text search. .

[Copy link]

0

Threads

56

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-4-6 14:15:01
| Show all posts
private int position = 0;

private void Button1_Click (object sender, System.EventArgs e)
{
if ((position = text2.Text.IndexOf (text1.Text.Trim (), position)) <0)
{
position = 0;
MessageBox.Show ("Search has reached the end of the document");
}
else
{
text2.Select (position, text1.Text.Trim (). Length);
position + = text1.Text.Trim (). Length;
}
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list