Created
February 18, 2021 01:54
-
-
Save valdessondev/0007317a30ad91700308e7e7b1bee23e to your computer and use it in GitHub Desktop.
Verificar se a string é vogal em DART Lang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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