I need to remove extra adjacent "spaces" other than 1 "space" if the text of the rich textbox contains any.But the code doesn't seem to work.
Private Sub RichTextBox1_TextChanged(sender As Object, e As EventArgs) Handles RichTextBox1.TextChanged
For i As Integer = 0 To RichTextBox1.Text.Length - 2
If RichTextBox1.Text.Chars(i) = " " And RichTextBox1.Text.Chars(i + 1) = " " Then
RichTextBox1.Text.Replace(RichTextBox1.Text.Chars(i + 1, "")
End If
Next
End Sub