title: Check if date String contains a year
body: <p>I have two Strings </p>
  
  <pre><code>String withYear = "12/04/1988"
  
  String withoutYear = "10/04"
  </code></pre>
  
  <p>The date format is MM/dd/yyyy</p>
  
  <p>I am trying to determine whether a string <strong>contains a year or not</strong>.</p>
  
  <p>Here is my code so far :</p>
  
  <pre><code>Calendar c= Calendar.getInstance();
  c.setTime(dt.parse(withYear)); //dt is a SimpleDateFormat 'MM/dd/yyyy'
  c.get(Calendar.YEAR) // = 1988
  
  c.setTime(dt.parse(withoutYear));
  c.get(Calendar.YEAR);// = 1970
  </code></pre>