diff --git a/3/functional_filter.d b/3/functional_filter.d index 8de6d0a..3209321 100644 --- a/3/functional_filter.d +++ b/3/functional_filter.d @@ -8,18 +8,18 @@ void main(){ // Loop style // A little better with foreach loop auto words = ["hello", "world", "dlang", "c++", "java"]; - int coolLangauges = 0; + int coolLanguages = 0; foreach(element ; words){ if(element=="dlang"){ - coolLangauges++; + coolLanguages++; } } - writeln("Cool langauges found: ",coolLangauges); + writeln("Cool languages found: ",coolLanguages); // Functional-style auto words2 = ["hello", "world", "dlang", "c++", "java"]; auto result = words.filter!(a=> a.indexOf("dlang") >=0).count; - writeln("Cool langauges found: ",result); + writeln("Cool languages found: ",result); }