title: java.lang.ArrayIndexOutOfBoundsException :
body: <p>I have a <code>String = "abc model 123 abcd1862893007509396 abcd2862893007509404"</code>, if I provide space between <code>abcd1</code> &amp; <code>number</code> eg. <code>abcd1 862893007509396</code> my code will work fine, but if there is no space like <code>abcd1862893007509396</code>, I will get <code>java.lang.ArrayIndexOutOfBoundsException</code>, please help ?:</p>
  
  <p>PFB the code :</p>
  
  <pre><code>String text = "";
  final String suppliedKeyword = "abc model 123 abcd1862893007509396 abcd2862893007509404";
  String[] keywordarray = null;
  String[] keywordarray2 = null;
  String modelname = "";
  String[] strIMEI = null;
  
  if ( StringUtils.containsIgnoreCase( suppliedKeyword,"model")) {
      keywordarray = suppliedKeyword.split("(?i)model");
  
      if (StringUtils.containsIgnoreCase(keywordarray[1], "abcd")) {
          keywordarray2 = keywordarray[1].split("(?i)abcd");
          modelname = keywordarray2[0].trim(); 
  
          if (keywordarray[1].trim().contains(" ")) {
              strIMEI = keywordarray[1].split(" ");
              for (int i = 0; i &lt; strIMEI.length; i++) {
                  if (StringUtils.containsIgnoreCase(strIMEI[i],"abcd")) {
                      text = text + " " + strIMEI[i] + " "
                              + strIMEI[i + 1];
                      System.out.println(text);
                  }
              }
          } else {
              text = keywordarray2[1];            
          }
      }
  }
  </code></pre>