How can we remove dollar sign ($) and all comma(,) from same string? Would it be better to avoid regex?
String liveprice = \"$123,456.78\";
Example using Swedish Krona currency
String x="19.823.567,10 kr";
x=x.replace(".",""); x=x.replaceAll("\\s+",""); x=x.replace(",", "."); x=x.replaceAll("[^0-9 , .]", "");
System.out.println(x);
Will give the output ->19823567.10(which can now be used for any computation)