title: Java methood split() not working with comma, array out of bounds
body: <p>I am trying to separate a string of an address entered by a user that is divided by commas. For example, If the user input the address </p>
  
  <p><code>"4367, 56th Avenue, Vancouver, BC, V4K1C3"</code></p>
  
  <p>I want and array with the values</p>
  
  <p><code>array ["4376", "56th Avenue", "Vancouver", "BC", "V4K1C3"]</code></p>
  
  <p>With indices 0 through 4. However, when implementing this in one of my classes, I keep getting an Array out of bounds errors when I assign the value of <code>array[1]</code> to a variable - As if everything is going into the 0 index of the array. Here is a snippet I wrote up that illustrates the issue:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Test {
     public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
  
    String fullAddress = input.next();
  
    String[] arr = fullAddress.split(",");
  
    System.out.println(arr[0]);
    System.out.println(arr[1]); //error java.lang.ArrayIndexOutOfBoundsException: 1
    System.out.println(arr[2]);
    System.out.println(arr[3]);
    System.out.println(arr[4]);
  
  
   }
  }
  </code></pre>
  
  <p>What is going wrong here?</p>