I wanted to get "a e" in the below code by trying to mimic a ternary operator, but getting below error
scala> val ab="apple"
ab: String = apple
scala> ab.toCharArray.map( x => "aeiou".indexOf(x) >= 0 )
res99: Array[Boolean] = Array(true, false, false, false, true)
scala> ab.toCharArray.map( x => "aeiou".indexOf(x) >= 0 ? x : ' ' )
<console>:1: error: identifier expected but character literal found.
ab.toCharArray.map( x => "aeiou".indexOf(x) >= 0 ? x : ' ' )
^
scala>