How to delete number of lines from richDataTextBox? I need to delete each second line.
For example, I have a text document, opened in rich DataTextBox..
1. "aaaaaaa
bbbbbbb
ccccccc
ddddddd"
How can I delete lines: "bbbbbbb" and "ddddddd"… and continue till the end of the text file.
var lines = this.dataTextBox.Lines;
You can use LINQ to delete every second line:
It selects all lines that should not be deleted and skips all others.