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.


Something like :

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.