title: Extracting token from a string
body: <p>I've a some strings like that "paddington road" and I need to extract the word "road" from this string. How can I do that? </p>
  
  <p>The problem is that I need to process a list of streets and extract some words like "road" "park" "street" "boulevard" and many others. </p>
  
  <p>What could be the best way to do that? The complexity is O(n*m) and if you consider that I process more than 5000 streets, the performance should be very important. </p>
  
  <p>I'm extracting the values from a Postgres db and putting into a List but I'm not sure it's the best way, may be a hash table is faster to query? </p>
  
  <p>I tried something like this:</p>
  
  <pre><code>    // Parse selectedList
      Iterator&lt;String&gt; it = streets.iterator();
      Iterator&lt;String&gt; it_exception = exception.iterator();
  
      int counter = streets.size();
      while(it.hasNext()) {   
  
          while ( it_exception.hasNext() ) {
              // remove substring it_exception.next() from it.next()              
          }               
      }
  </code></pre>
  
  <p>What do you think?</p>