Convert String into Integers representing a date
<p>I need to turn a string that represents a date into a date.</p>

<p>A date is constructed like this:</p>

<pre><code>private int m;
private int d;
private int y;

public Date(int month, int day, int year) {
      if (isValidDate(month, day, year)) {
          m = month;
          d = day;
          y = year;  
      } else {
          System.out.println("Error: not a valid date");
          System.exit(0);
      }
  }
</code></pre>

<p>The string that needs to be converted into this date object is in the format:</p>

<pre><code>"month/day/year"
</code></pre>

<p>The month is 1 or 2 characters, the day is 1 or 2 characters and the year can be 1 - 4 characters.</p>

<p>My idea was to loop through the string and find when the character <code>/</code> appears but I feel like there is a better way of going about it.</p>

<p>What would be the best way to accomplish this?</p>
