Created
November 21, 2023 13:40
-
-
Save bjoerntx/4ffdf79202b8263d864a644ba96c96b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void RemoveAllSections(TextControl textControl) | |
{ | |
// remove all sections | |
for (int section = 2; section <= textControl.Sections.Count;) | |
{ | |
// set the input position to the start of the section | |
textControl.Select(textControl.Sections[section].Start - 2, 0); | |
// add a new paragraph | |
textControl.Selection.Text = "\r\n"; | |
// select the end of paragraph character | |
textControl.Selection.Length = 1; | |
// remove the paragraph | |
textControl.Selection.Text = ""; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment