开发者

What's a regex to replace "(11245)"

开发者 https://www.devze.com 2023-02-10 11:34 出处:网络
I need a regex fo开发者_JAVA百科r String.replaceAll(...) in Java to remove brackets and their contents.

I need a regex fo开发者_JAVA百科r String.replaceAll(...) in Java to remove brackets and their contents.

For example:

 hello(100)

to:

 hello


Try this

theString.replaceAll("\\(.*?\\)", "")
0

精彩评论

暂无评论...
验证码 换一张
取 消