I wrote a short program to delete all sentences in a paragraph that contains certain words.
After I finished I found that it can only handle sentences ending with . but I don't know how to make it also work for ! ? ; etc.
My problem is that split() only takes one delimitor. Can any one give me some ideas on how to do multiple delimitors to break a paragraph? Thanks.
Function RMNumS(desc As String)
Dim d As Variant, desc2 As String
Dim i As Long
d = Split(desc, ".")
For i = 0 To UBound(d)
If InStr(d(i), "a") = 0 Then
desc2 = desc2 & d(i) & ". "
End If
Next i
RMNumS = desc2
End Function
After I finished I found that it can only handle sentences ending with . but I don't know how to make it also work for ! ? ; etc.
My problem is that split() only takes one delimitor. Can any one give me some ideas on how to do multiple delimitors to break a paragraph? Thanks.
Function RMNumS(desc As String)
Dim d As Variant, desc2 As String
Dim i As Long
d = Split(desc, ".")
For i = 0 To UBound(d)
If InStr(d(i), "a") = 0 Then
desc2 = desc2 & d(i) & ". "
End If
Next i
RMNumS = desc2
End Function