I have a map of key value pairs and I am trying to fetch the value given a key, however although it returns me a value it comes along with some, any idea how can I get rid of it? My code is:
val jsonmap = simple.split(",\"").toList.map(x => x.split("\":")).map(x => Tuple2(x(0), x(1))).toMap
val text = jsonmap.get("text")
Where "text" is the key and I want the value that it is mapped to, I am currently getting the following output:
Some("4everevercom")
I tried using flatMap instead of Map but it doesn't work either