How can we remove dollar sign ($) and all comma(,) from same string? Would it be better to avoid regex?
String liveprice = \"$123,456.78\";
Will this works?
String liveprice = "$123,456.78"; String newStr = liveprice.replace("$", "").replace(",","");
Output: 123456.78
123456.78
Better One:
String liveprice = "$123,456.78"; String newStr = liveprice.replaceAll("[$,]", "")