RichTextBox nesnesinde yinelenenleri kaldırmaya yarayan csharp kodu alternatifidir.
public static void YinelenenleriKaldir(RichTextBox richTextBox)
{
if (richTextBox.SelectedText.Length == 0)
{
richTextBox.Text = string.Join(Environment.NewLine, richTextBox.Lines.Distinct());
}
else if (richTextBox.SelectedText.Length > 0)
{
richTextBox.SelectedText = string.Join(Environment.NewLine, richTextBox.Lines.Distinct());
}
}