小说网 找小说 无限小说 烟雨红尘 幻想小说 酷文学 深夜书屋

How to remove all characters between two brackets?

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
 

Sub test()
MsgBox StringWithoutBrackets("12345 (rtetnj) dsfd (fddsgd) dsf ")
End Sub
 

posted on 2007-06-25 02:52  王峰炬  阅读(106)  评论(0编辑  收藏  举报

导航