title: Humanize a string in JavaScript
body: <p>How do I humanize a string? Based on the following criteria:</p>
  
  <blockquote>
    <ul>
    <li>Deletes leading underscores, if any.</li>
    <li>Replaces underscores with spaces, if any.</li>
    <li>Capitalizes the first word.</li>
    </ul>
  </blockquote>
  
  <p>For example:</p>
  
  <pre><code>this is a test -&gt; This is a test
  foo Bar Baz    -&gt; Foo bar baz
  foo_bar        -&gt; Foo bar
  foo_bar_baz    -&gt; Foo bar baz
  foo-bar        -&gt; Foo-bar
  fooBarBaz      -&gt; FooBarBaz
  </code></pre>