How can we remove dollar sign ($) and all comma(,) from same string? Would it be better to avoid regex?
String liveprice = \"$123,456.78\";
Try,
String liveprice = "$123,456.78"; String newStr = liveprice.replaceAll("[$,]", "");
replaceAll uses regex, to avoid regex than try with consecutive replace method.
replaceAll
replace
String liveprice = "$1,23,456.78"; String newStr = liveprice.replace("$", "").replace(",", "");