code: public static String capitalize(CharSequence self) {
          String s = self.toString();
          if (s == null || s.length() == 0) return s;
          return Character.toUpperCase(s.charAt(0)) + s.substring(1);
      }
docs: Convenience method to capitalize the first letter of a CharSequence
  (typically the first letter of a word). Example usage:
  <pre class="groovyTestCase">
  assert 'h'.capitalize() == 'H'
  assert 'hello'.capitalize() == 'Hello'
  assert 'hello world'.capitalize() == 'Hello world'
  assert 'Hello World' ==
  'hello world'.split(' ').collect{ it.capitalize() }.join(' ')
  </pre>
  
  @param self The CharSequence to capitalize
  @return A String containing the capitalized toString() of the CharSequence
  @see #capitalize(String)
  @since 1.8.2