title: How to check if the field contains hyphen character in java
body: <p>My Object returns me <code>-</code> from 
      Log.d("FormattedDate", Object.getDOB());    </p>
  
  <pre><code>if (!Object.getDOB().matches("[^-]*")) {
      txtDOB.setText(Object.getDOB());
     } else {
      txtDOB.setText("-");
  }
  </code></pre>
  
  <p>I am checking if my Object.getDOB() matches with <code>-</code>, then show emptry strings, but this regExp is not working.</p>