Maybe I am using replaceAll incorrectly, but I am unable to find why it acts this way. I want to simply remove a $ sign from a string and then output the string.
public class Example{
  public static void main(String[] args){
    String s = "$50";
    s.replaceAll("\\D+", "");
    System.out.println(s);
  }
}
However, this still outputs the $ symbol with the string. Does anyone know why this is happening?
 
    