fork(1) download
  1. import java.util.*
  2.  
  3. fun main(args: Array<String>) {
  4. val msg = " The cat won't stay away from the chickens. "
  5. val tokens = msg.trim().split("""\s+""".toRegex())
  6. println(tokens.joinToString(", "))
  7. }
Success #stdin #stdout 0.12s 40608KB
stdin
Standard input is empty
stdout
The, cat, won't, stay, away, from, the, chickens.