0
我有這個字符串字符串轉換爲JSON對象的數組,軌道3+
astring='[{"name": "daus", "total": "45", "ios": "30", "android": "15"},{"name": "davus", "total": "38", "ios: 27", "android": "11"}]'
,我想通過
ajson = JSON.parse(astring)
將其轉換成JSON,但我收到此錯誤:
JSON::ParserError: 399: unexpected token at '{"name": "davus", "total": "38", "ios: 27", "android": "11"}]'
我假設我的錯誤是在我設置初始字符串的方式,但還沒有能夠解決它。