title: Run-time error in .split("|")
body: <p>I'm using that method in that line:</p>
  
  <pre><code>f.getCmbAttori().getSelectedItem().toString().split("|")
  </code></pre>
  
  <p>with an input like "13|Il Signore degli Anelli" and insted of return:</p>
  
  <pre><code>f.getCmbAttori().getSelectedItem().toString().split("|")[0] = "13"
  f.getCmbAttori().getSelectedItem().toString().split("|")[1] = "Il Signore degli Anelli"
  </code></pre>
  
  <p>It returns an array where every character is alone, like this:</p>
  
  <pre><code>    f.getCmbAttori().getSelectedItem().toString().split("|")[0] = ""
      f.getCmbAttori().getSelectedItem().toString().split("|")[1] = "1"
      f.getCmbAttori().getSelectedItem().toString().split("|")[2] = "3"
      f.getCmbAttori().getSelectedItem().toString().split("|")[3] = "|"
      f.getCmbAttori().getSelectedItem().toString().split("|")[4] = "I"
      f.getCmbAttori().getSelectedItem().toString().split("|")[5] = "l"
  [...]
  
      f.getCmbAttori().getSelectedItem().toString().split("|")[25] = "l"
      f.getCmbAttori().getSelectedItem().toString().split("|")[26] = "i"
  </code></pre>
  
  <p>How can be possible that? I'm wrinting this method in a wrong way? Here a piece of code where I use that:</p>
  
  <pre><code>PreparedStatement stmSql = null;
                   int risultato = 0;                  
                   stmSql = f.conn.prepareStatement("insert into recita (CodAttore, CodFilm) values (?, ?)");
                   stmSql.setInt(1, Integer.parseInt(f.getCmbAttori().getSelectedItem().toString().split("|")[1]));
                   stmSql.setInt(2, Integer.parseInt(f.getCmbFilmRecita().getSelectedItem().toString().split("|")[1]));
                   risultato = stmSql.executeUpdate();
  </code></pre>