title: Capitalize First Letter Of Each Name after Hyphen "-" and Space " "
body: <p>I'm currently using this String extension to Capitalize the letter of each word in a textField :</p>
  <p><code>&quot;happy sunshine&quot;</code>  <code>.toTitleCase()</code> gives <code>&quot;Happy Sunshine&quot;</code></p>
  <pre><code>extension StringExtension on String {
    String toTitleCase() =&gt; replaceAll(RegExp(' +'), ' ')
        .split(' ')
        .map((str) =&gt; str.toCapitalized())
        .join(' ');
    String toCapitalized() =&gt;
        length &gt; 0 ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}' : '';
  }
  </code></pre>
  <p>but I'd also like to Capitalize letters that come after a hyphen <code>-</code> with the same <code>toTitleCase</code> method</p>
  <p>ex : <code>&quot;very-happy sunshine&quot;</code>  <code>.toTitleCase()</code> would give <code>&quot;Very-Happy Sunshine&quot;</code></p>
  <br>
  <p>Currently <code>.toTitleCase()</code> gives <code>&quot;Very-happy Sunshine&quot;</code> : (</p>