title: Whitespace split issue, java
body: <p>beginner here I have searched anywhere but I can't seem to find any solution or problems related to mine. I've just started learning java and Here is my problem:</p>
  <p>I have a working code where the input is split by &quot;/&quot;:</p>
  <pre><code>Scanner d = new Scanner(System.in);
  System.out.println(&quot;Enter your birthday (mm/dd/yyyy): &quot;);
  String birthday = d.next();
  
  String[] bdayArr = birthday.split(&quot;/&quot;, 3);
  
  int current = 2022;
  int age = current - Integer.parseInt(bdayArr[2]);
  </code></pre>
  <p>now it was just a solution for the meantime as the date format I want to needs to be seperated with spaces (ex, January 21, 1899)
  and the purpose of me splitting is i need to get the year to use in a code block that computes the age of the person based on the birth year.</p>
  <p>However, when i try to split it by whitespace I can't seem to access the array anymore. Error codes ranging from out of bounds to a NumberFormatException when i input (ex: January 21, 1989) (code below)</p>
  <p><code>String[] bdayArr = birthday.split(&quot;\\s+&quot;, 3);</code></p>
  <p>I don't know what i'm doing wrong, hopefully someone can help. (I know the question is too long and not straight to the point I wanted to provide as much context)</p>