I want to convert a string (for example $4.50) to a double. I understand I can use Double.parseDouble() but I assume this works only if the string does not contain any other chars (such as the dollar sign). The purpose is to compare two Strings (which contain dollar values plus a dollar sign) and determine which one is greater and which one is smaller
How can I convert such a string to a double?