title: Replacing dashes and commas in Java with spaces
body: <p>I am trying to remove all dashes (-) and commas (,) using the replaceall function in Java. However, I can only remove either the dash, or the comma. How can I fix this?</p>
  
  <pre><code>if (numOfViewsM.find()){
      if (numOfViewsM.toString().contains(","))
      {
          numOfViews =Integer.parseInt(numOfViewsM.group(1).toString().replaceAll(",", ""));
      }
      else if (numOfViewsM.toString().contains("-"))
      {
          numOfViews = Integer.parseInt(numOfViewsM.group(1).toString().replaceAll("-", ""));
      }
      else
          numOfViews = Integer.parseInt(numOfViewsM.group(1));
  }
  </code></pre>