Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- String string1;
- String string2;
- string1 = textBox1.Text;
- string2 = textBox2.Text;
- int position = 0;
- while (position != -1)
- {
- position = string1.IndexOf(string2, position);
- }
- if (position != -1)
- {
- position = position + 1;
- label1.Text = ("Antalet bokstäver=" + position);
- }
- if (string1.IndexOf(string2) == -1)
- { label1.Text = "Not Found";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement