在javascript中,如何将字符串转换为JSON格式

只需使用JSON.parse即可,例:


var jsonObject = JSON.parse('{"Hello":"world"}');