title: Ruby 'Capitalize!' paradox
body: <p>In Ruby we have the 'bang' method <code>capitalize!</code> which has the strange behavior of returning a <code>nil</code> if no changes to the string were made.</p>
  
  <p>That means I can't chain this commands with other since it effectively destroys the chain if it returns <code>nil</code>.</p>
  
  <p>What im trying to do is something like this:</p>
  
  <pre><code>fname =  fullname[0...fullname.index(' ')].capitalize!
  </code></pre>
  
  <p>which extracts the first name from a string and should capitalize it as well. But if it is already capitalized the string stored in <code>fname</code> is <code>nil</code>.</p>
  
  <p>Of courses I can add another statement but was wondering if there is a way to do this "without breaking the chain".</p>