[ad_1]
Valid Scala syntax is
ab.toCharArray.map(x => if ("aeiou".indexOf(x) >= 0) x else ' ')
On contrary
ab.chars().map(x -> "aeiou".indexOf(x) >= 0 ? x : ' ');
is Java syntax.
1
[ad_2]
solved scala how to mimic a ternary operator in anonymous functions