val str = "[{"hash":"0x32b9e3153d1db4f3ef612e90e3af419a357a02de4265cd01a19e778bca757df6","nonce":"0x1","blockHash":"0xf9b000e39243976d0cc0aaa3596ce1074ef6b8bc28abcaaac9ce05448cfbf780","blockNumber":"0xcf13","transactionIndex":"0x0","from":"0x6111e933e5e6297dfd0aad9aab64017c69062a08","to":"0x32be343b94f860124dc4fee278fdcbd38c102d88","value":"0x1e5b4ec12df20c000","gasPrice":"0xccc934498","gas":"0x5208","input":"0x","creates":null,"publicKey":null,"raw":null,"r":"0xb77c0e7971d562af0274fd9a5a862fa601e1753326f59504c4e41da55dd2fb33","s":"0x6883e92fda5a7ae5e9a7e990dab2d09d8256290e78a4abf892bdf68ad9c0b79f","v":28}]" println(str) //转换为数组 val jsonArr:JSONArray = JSON.parseArray(str) val objs = (0 until jsonArr.size()).map(jsonArr.getJSONObject) //转换为对象数组 objs.foreach{x => println(x) }