mercredi 4 mars 2015

My filter loop in scala doesn't work?


for(i <- data){
if(i != 'a' || i != 'e' || i != 'i' || i != 'o' || i != 'u'){
myArray(i) = i;
println(myArray(i));
}
}


Data is a passed in string, and myArray variable is a char array. Why is it that when the char selected is in-putted into myArray it can be a vowel? Please help, thanks.


Aucun commentaire:

Enregistrer un commentaire