How to create a loop from a string based on a delimiter
<p>I have a string like this:</p>

<pre><code>var string = ' [United States] [Canada] [India] ';
</code></pre>

<p>I want to do a for loop and add each of the countries into an array in Javascript or Jquery, something like this:</p>

<pre><code>var countryArray = new Array();
for ( each country in string AS country) {
  countryArray.push(country);      
}
</code></pre>

<p>I'm not sure how I would make a foreach loop out of a string like that.</p>
