Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My:
- object Wub {
- def songDecoder(song: String): String = song.split("WUB").toList.filter(x=>x!="").mkString(" ")
- }
- Other:
- object Wub {
- def songDecoder(song: String): String =
- song.replaceAll("(WUB)+", " ").trim
- }
- object Wub {
- def songDecoder(song: String): String = song.split("WUB").filter(!_.isEmpty).mkString(" ")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement