I have a string value where I am getting the a integer with ')' I want to remove the ')' have the value separated from all the unwanted special characters. Do any one here have any idea how can I remove the ')'. I have tried stringValue.replace('\)'. ''), but it is not working.

1 Answer 1


Something like :

String s = '(09890)';
Integer i = Integer.valueOf(s.replaceAll('[\\(\\)]',''));

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .