Skip to content

Instantly share code, notes, and snippets.

@zion830
Last active August 19, 2020 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zion830/b8fc2a89c3ffa4e1968203f0aefb9568 to your computer and use it in GitHub Desktop.
Save zion830/b8fc2a89c3ffa4e1968203f0aefb9568 to your computer and use it in GitHub Desktop.
fun main() {
while (true) {
val r = readLine()?.replace(",", "','")
var result = "["
result += r?.split(" ")?.joinToString("") {"{'$it'}, "}
result = result.dropLast(2) + "]"
println(result.replace("','", "', '"))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment