title: Array Index Out of Bounds - not sure where to look
body: <p>I'm getting an exception when I run my program. It compiles ok and it was working earlier so I'm not sure what's wrong.
  The error:
  <a href="http://gyazo.com/091235db6cc37154e8f7304e4c1482a8" rel="nofollow">http://gyazo.com/091235db6cc37154e8f7304e4c1482a8</a></p>
  
  <p>It's supposed to print out a sequence given in a sideways tree. </p>
  
  <pre><code>import java.io.*;
  import java.util.Scanner;
  
  public class PrintSideWays{
  
      public static void main (String[] args){
          PrintSideWays p = new PrintSideWays();
          p.start(args[0]);
  
      }
  
      public void start (String args){
          buildTree(args);
  
      }
  
      public void buildTree(String preorder){
  
          BinarySearchTree&lt;StringItem, String&gt; bst = new BinarySearchTree&lt;StringItem, String&gt;();
          StringItem stringItem;
  
  
  
          System.out.println("Sideways printing tree by wcor690:");
  
  
  
          for ( int i=0; i &lt; preorder.length() ; i++){
              String letter = preorder.substring(i,i+1);
              stringItem = new StringItem(letter);
              bst.insert(stringItem);
  
  
  
          }
           TreeNode root = bst.getRoot();
           print(root, " ");
  
          System.out.print("Inorder traversal:");
           inorderTraversal(root);
           System.out.println();
  
          System.out.println("Please enter the remove sequence: ");
          Scanner in = new Scanner(System.in);
          String userRemove = in.next();
  
          for(int i = 0; i &lt; userRemove.length(); i++){
              String letter =  userRemove.substring(i,i+1);
              StringItem removeString = new StringItem(letter);
              try{ bst.delete(removeString);
                  }
              catch(TreeException e){
                  System.out.println(letter + " not found in tree.");
              }
          }
  
          print(root, " ");
  
          System.out.print("Inorder traversal:");
           inorderTraversal(root);
            System.out.println();
      }
  
      public void inorderTraversal(TreeNode node){
  
       if(node == null){
        return;
       }
  
        inorderTraversal(node.getLeft());
        System.out.print(node.getItem());
        inorderTraversal(node.getRight());
  
      }
      public void print(TreeNode treeNode, String indent ) {  
          if (treeNode == null){ 
              return; 
          }
  
          print( treeNode.getRight(), indent + "   " );  
          System.out.println(indent + treeNode.getItem());  
          print(treeNode.getLeft(), indent + "   ");
      }
  }  
  </code></pre>