Is this an acceptable approach for removing multiple character types from a string or is there a better (more efficient way)? The \"ilr\".contains(_) bit feels
There would be no significant difference, since there is only 3 characters to remove and no so big string to filter, but you may consider to use Set for this purpose. E.g.
val toRemove = "ilr".toSet
val words = sentence.filterNot(toRemove)