fork download
  1. object Main extends App {
  2.  
  3. var jsonp =
  4. """_SS_MainSolrCallbackH(
  5. {
  6. response: {
  7. numFound: 1,
  8. start: 0,
  9. maxScore: 4.9338827,
  10. docs: [
  11. {
  12. tipo: "M",
  13. id: "mus1933196",a
  14. s: 4.9338827,
  15. u: "daniellaalcarpe",
  16. d: "lagrima-de-amor",
  17. dd: "",
  18. f: "202114_20130510215437.jpg",
  19. a: "Daniella Alcarpe",
  20. t: "Lágrima De Amor",
  21. g: "MPB"
  22. }
  23. ]
  24. },
  25. highlighting: {
  26. mus1933196: {
  27. titulo: [
  28. "Lágrima <b>De</b> <b>Amor</b>"
  29. ]
  30. }
  31. }
  32. }
  33. )""";
  34.  
  35. def toJson(jsonp: String): String = {
  36. jsonp.substring(jsonp.indexOf('{'), jsonp.lastIndexOf('}') + 1);
  37. }
  38. System.out.println(toJson(jsonp));
  39.  
  40. }
Success #stdin #stdout 0.24s 382656KB
stdin
Standard input is empty
stdout
{
			    response: {
			      numFound: 1,
			      start: 0,
			      maxScore: 4.9338827,
			      docs: [
			        {
			        tipo: "M",
			        id: "mus1933196",a
			        s: 4.9338827,
			        u: "daniellaalcarpe",
			        d: "lagrima-de-amor",
			        dd: "",
			        f: "202114_20130510215437.jpg",
			        a: "Daniella Alcarpe",
			        t: "Lágrima De Amor",
			        g: "MPB"
			        }
			      ]
			    },
			    highlighting: {
			      mus1933196: {
			        titulo: [
			          "Lágrima <b>De</b> <b>Amor</b>"
			        ]
			      }
			    }
			  }