|
If your carriage returns are all hard carriage returns, consider using regular expression objects to simplify operations.
The purpose of my program is to delete blank lines and blank lines containing spaces:
Private Sub Command1_Click()
Dim temp As String, s() As String, i As Long
temp = RichTextBox1.Text
s = Split(temp, vbCrLf)
For i = 0 To UBound(s)
If Len(Trim(s(i))) = 0 Then s(i) = ""
Next
temp = Join(s, vbCrLf)
While InStr(temp, vbCrLf&vbCrLf)> 0
temp = Replace(temp, vbCrLf&vbCrLf, vbCrLf)
Wend
RichTextBox1.Text = temp
End Sub |
|