Skip to content

Instantly share code, notes, and snippets.

@goungoun
Forked from takezoe/JSONSample.scala
Created October 17, 2018 02:56
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 goungoun/02e446e36d1ef577ca14c5f9707fc86d to your computer and use it in GitHub Desktop.
Save goungoun/02e446e36d1ef577ca14c5f9707fc86d to your computer and use it in GitHub Desktop.
Example of scala.util.parsing.json
import scala.util.parsing.json._
val result = JSON.parseFull("""
{"name": "Naoki", "lang": ["Java", "Scala"]}
""")
result match {
case Some(e) => println(e) // => Map(name -> Naoki, lang -> List(Java, Scala))
case None => println("Failed.")
}
@goungoun
Copy link
Author

forked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment