fork download
  1. void main() {
  2. const text = 'FOO BAR BAZ ZUZ';
  3.  
  4. // Conta quantas letras A (em maiusculo), retorna 2
  5. print('A'.allMatches(text).length);
  6.  
  7. // Conta quantas letras F (em maiusculo), retorna 1
  8. print('F'.allMatches(text).length);
  9.  
  10. // Conta quantas letras Z (em maiusculo), retorna 3
  11. print('Z'.allMatches(text).length);
  12. }
Success #stdin #stdout 1.11s 126036KB
stdin
Standard input is empty
stdout
2
1
3