Reputation: 4741
Trying to remove city code from string for my additional I have wrote the brackets removal with indexOf. how to do this with regex?
Mr Smith (344) 455 66 44
to
Mr Smith 455 66 44
Upvotes: 0
Views: 1665
Reputation: 46239
You can use
String clean = str.replaceAll("\\(\\d+\\)", "");
Upvotes: 5