I haven't tested your code, but an obvious mistake is that you don't change richtextbox text but its copied value. therefore, you never see strike-out text removed. try the following code:
private void buttonRemove_Click(object sender, EventArgs e)
{
int pos = 0, lastpos = 0;
char[] sep = new char[] { ' ' };
while ((lastpos = this.richTextBox1.Find(sep, pos)) > pos)
{
try
{
if (lastpos - pos == 1)
{
continue;
}
try
{
this.richTextBox1.Select(pos, lastpos - pos);
if (this.richTextBox1.SelectionFont.Strikeout)
this.richTextBox1.SelectedText = string.Empty;
}
catch (ArgumentOutOfRangeException)
{
break;
}
}
finally
{
pos = lastpos + 1;
}
}
if (pos + 1 < this.richTextBox1.Text.Length)
{
this.richTextBox1.Select(pos, this.richTextBox1.Text.Length - pos);
if (this.richTextBox1.SelectionFont.Strikeout)
this.richTextBox1.SelectedText = string.Empty;
}
}