How can we remove dollar sign ($) and all comma(,) from same string? Would it be better to avoid regex?
String liveprice = "$123,456.78";
do like this
NumberFormat format = NumberFormat.getCurrencyInstance(); Number number = format.parse("$123,456.78"); System.out.println(number.toString());
output
123456.78
2.1m questions
2.1m answers
60 comments
57.0k users