Skip to content

Instantly share code, notes, and snippets.

@valdessondev
Created February 18, 2021 01:54
Show Gist options
  • Save valdessondev/0007317a30ad91700308e7e7b1bee23e to your computer and use it in GitHub Desktop.
Save valdessondev/0007317a30ad91700308e7e7b1bee23e to your computer and use it in GitHub Desktop.
Verificar se a string é vogal em DART Lang
void main (){
// Entrada de dados
String letra = 'r';
String textoV='',textoC='';
List<String> ListaVogal=['a','e','i','o','u'];
//Processamento e Saída de dados
for(var vogal in ListaVogal) {
letra=letra.toLowerCase();
if(vogal==letra){
textoV='$letra é o vogal';
} else{
textoC='$letra é uma consuante';
}
}
if(textoV!=''){
print ('$textoV');
}
else{
print ('$textoC');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment