How to delete a full stop after the last sentence in a RichTextBox programmatically.
Posted on 2011-05-09
Please note I am using Visual Studio 2010.
I need help with code (in Visual Basic) that will search backwards for the first fullstop in a RichTextBox from the current cursor position and one finding it, will delete this full stop.
So if there is following text in a RichTextBox.
This is the first sentence.
This is the second sentence. This is the third target sentence.
And if the cursor is at the end of the above paragraph (that is to the right of the fullstop after the third sentence, I would like the code to search and find this last full stop in this paragraph and delete this full stop.
So the above paragraph after running the code will look like as follows:
This is the first sentence. This is the second sentence. This is the third target sentence
As you can see the full stop after the third sentence has been deleted after running the code.
Please note that before the code I am looking for runs, the cursor will be at the end of all the text in the RichTextBox.
Thank you for your help in anticipation.