Advertisement
MiroJoseph

Dubstep

Apr 8th, 2020
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.33 KB | None | 0 0
  1. My:
  2. object Wub {
  3. def songDecoder(song: String): String = song.split("WUB").toList.filter(x=>x!="").mkString(" ")
  4. }
  5.  
  6. Other:
  7. object Wub {
  8.  
  9.   def songDecoder(song: String): String =
  10.     song.replaceAll("(WUB)+", " ").trim
  11. }
  12.  
  13. object Wub {
  14.   def songDecoder(song: String): String = song.split("WUB").filter(!_.isEmpty).mkString(" ")
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement