[Solved] searching for list of vowels and replacing the vowels with dot (.) in a given string in scala [closed]


Check below code.

scala> val vowels= Set('a','e','i','o','u') // List Of vowels
oval: Seq[Char] = List(a, e, i, o, u)

scala> val data = "BangaLore" // Value
data: String = BangaLore

scala> data.toLowerCase.map(c => if(vowels(c)) '.' else c)
res17: String = b.ng.l.r.

4

solved searching for list of vowels and replacing the vowels with dot (.) in a given string in scala [closed]