title: My mat-table is sorting by capitalized words, how can i fix this in angular?
body: <p>I'm trying to use the mat-sort to order one mat-table in angular, the problem is when i order in ascendent/decrescent order, the algoritm order capitalized words first than uncapitalized. If i have one table with this names:</p>
  
  <p>"Mark" 
  "antony"</p>
  
  <p>"Mark" shows first than antony.</p>
  
  <p>This is the algoritm:</p>
  
  <pre><code>sortData(sort: Sort) {
      const data = this.descricoesProdutos.slice();
      if (!sort.active || sort.direction === '') {
        this.sortedData = data;
        return;
      }
  
      this.sortedData = data.sort((a, b) =&gt; {
        const isAsc = sort.direction === 'asc';
        switch (sort.active) {
          case 'nome': return this.compare(a.nome, b.nome, isAsc);
          case 'descricao': return this.compare(a.descricao, b.descricao, isAsc);
          default: return 0;
        }
      });
    }
  
  
    compare(a: number | string, b: number | string, isAsc: boolean) {
    return (a &lt; b ? -1 : 1) * (isAsc ? 1 : -1);
    }
  </code></pre>
  
  <p>My html:</p>
  
  <pre><code>&lt;table matSort (matSortChange)="sortData($event)"&gt;
  </code></pre>