I'm getting response from the server like this "[ 61 ]" I want to get rid of the parentheses and keep the numbers only.
This is what I did, but this does not work for dynamic responses, it only fits static number, but if the number gets bigger, this doesn't work
@Override
public void onResponse(String response) {
StringBuffer sb = new StringBuffer(response);
sb.deleteCharAt(0);
sb.deleteCharAt(7);
numberofvotes.setText("Counts : " + sb.toString().trim());
}
How can I remove parentheses anywhere in the string?