How to remove all characters between two brackets?
Such as "12345 (rtetnj) dsfd (fddsgd) dsf "----> "12345 dsfd dsf "
Use regexp syntaxes ,it's too simple .
Function StringWithoutBrackets(ByVal s As String) As String
With CreateObject("VBSCRIPT.REGEXP")
.Global = True
.Pattern = "[(][^)]*[)]"
StringWithoutBrackets = .Replace(s, "")
End With
End Function
With CreateObject("VBSCRIPT.REGEXP")
.Global = True
.Pattern = "[(][^)]*[)]"
StringWithoutBrackets = .Replace(s, "")
End With
End Function
Sub test()
MsgBox StringWithoutBrackets("12345 (rtetnj) dsfd (fddsgd) dsf ")
End Sub