title: Returning an array of string words with more than 5 letters
body: <p>Here is the problem specification:</p>
  
  <p><strong>Write a static  method , getBigWords, that gets a single String  parameter  and returns an array  whose elements  are the words in the parameter  that contain more than 5 letters. (A word is defined as a contiguous sequence of letters.) 
  EXAMPLE: So, if the String  argument  passed to the method  was "There are 87,000,000 people in Canada", getBigWords would return an array  of two elements , "people" and "Canada". 
  ANOTHER EXAMPLE: If the String  argument  passed to the method  was "Send the request to support@turingscraft.com", getBigWords would return an array  of three elements , "request", "support" and "turingscraft".</strong> </p>
  
  <p>My approach was to declare a variable length array, and also split the string sequence into tokens pieces. Then I passed the tokens pieces into a method. Essentially, I wanted to check that each token element in the array with more than 5 elements has a contiguous sequence of letters. If not, break out of the loop and move to the next token. If so, add each letter in the token to a new array of String builders. Then, when all the loop iterations are done, I return the String builder array as a string array. I then assign the return value to the variable length array.</p>
  
  <p>I am trying to figure out how to declare an array String builder. The array must be of variable length, to allow me to append letters to each element.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>public static String getBigWords(String string){
  String[] tokens = string.split(" ");
  java.util.ArrayList&lt;String&gt; array = new ArrayList&lt;String&gt;();
  
  array = isNoDigit(tokens);
  
      public static String isNodigit(String[] param);
      StringBuilder[] builder = new StringBuilder[param.length];
  
      for (int i = 0; param.length(); i++){
          if (param[i].length() &gt; 5){
              for (int j = 0; j &lt; param[i].length(); j++)
                  if ((Character.isLetter(param[i].charAt(j))){
                      builder.append(param[i].charAt(j));
                  }
                  else
                      break;
              }
          }
      }
      return builder.toString         
  }
  return array.toArray(new String[0]);
  }
  </code></pre>
  
  <p>Updated code:</p>
  
  <pre><code>public static String[] getBigWords(String sequence) {
  sequence = sequence.replace("@", " ");
  sequence = sequence.replace(".", " ");
  sequence = sequence.replaceAll("\\d+.", "");
  
  java.util.ArrayList&lt;String&gt; array = new java.util.ArrayList&lt;String&gt;();
  
  String[] tokens = sequence.split(" ");
  
  for (int i = 0; i &lt; tokens.length(); i++) {
      if (tokens[i].length() &gt; 5) {
          array.add(tokens[i]);
      }
  }
  return array.toArray(new String[0]);
  }           
  </code></pre>