title: How to capitalize first letter and lowercase the rest of the string
body: <p>I am trying to capitalize the first letter of only the first word in a sentence.</p>
  <p>This is the data in the tsx file  { this.text({ id: <code>downloadPriceHistory</code>, defaultMessage: 'Download Price History' }) }
  the id shown above comes from the database where it could be send to the api in various forms.
  </p>
  <p>I have tried to use this logic below:</p>
  <pre><code>export function titleCase(string) {
      string = 'hello World';
      const sentence = string.toLowerCase().split('');
        for (let i = 0; i &lt; sentence.length; i++) {
            sentence[i] = sentence[i][0].toUpperCase() + sentence[i];
      }
       return sentence;
  
  }
  </code></pre>
  <p>For example, for the input <code>&quot;Download Price History&quot;</code>, the result should be <code>&quot;Download price history&quot;</code>.</p>