title: Capitalize the first letter in a ArrayList of names
body: <p>I need to capitalize the first name, and last name in a ArrayList, Example:</p>
  
  <p>input:</p>
  
  <pre><code>colette Sapienza
  gretta Beumer
  EMManuel Mossman
  Colette Sapienza
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Colete Sapienza
  Gretta Beumer
  Emmanuel Mossman
  Colette Sapienza
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>ArrayList&lt;String&gt; a;
  a = getNames();
  
  
  for(int i=0; i &lt; a.size(); i++){ 
    if(i==0)
      a.set(i, a.get(i).toUpperCase());
    else if (i &gt; 0 &amp;&amp; i-1 ==' ')
      a.set(i, a.get(i).toUpperCase());
    else
      a.set(i,a.get(i).toLowerCase());
  }
  
  return a;
  </code></pre>