title: Is there a way to make consistent result out of split function?(same amounts of words)
body: <p>I am working on search function and I am splitting search query into separated words. I know that there will be no more than 10 words, but there might be less.</p>
  
  <p>Since I need to make SQL query, with consistent amount of words, let's say 10, I need to add 8 more blank words in case user typed only 2. </p>
  
  <p>Is there any smart way how to do it or should I just make a loop from 1 to 10 and check if that particular position is null, if yes then fill it with blank word?</p>
  
  <p>SQL query would look something like this(but with 9 ANDs):</p>
  
  <pre><code>SELECT * FROM mytable
  WHERE column1 LIKE '%word1%'
  AND column1 LIKE '%word2%'
  AND column1 LIKE '%word3%'
  </code></pre>
  
  <p>Basically what I want to do is this, but maybe in some smarter way:</p>
  
  <pre><code>    String[] finalSearch = new String[10];
      String[] search=searchInput.split(" ", -1);
  
      for (int i=0; i&lt;10; i++){
          if (search[i]!=null){
              finalSearch[i] = search[i];
          }else{
              finalSearch[i]="";
          }
      }
  </code></pre>