字符串转换问题
老师你好,请问如果请求到的是一串类似【student: "张三$12#李四$13$$$小芳$11#小红$12"】这样的字符串,如何才能转换拼接成下面这种形式的数组?
student:[ boy:[ { name: "张三", age: 12 }, { name: "李四", age: 13 } ], girl: [ { name: "小芳", age: 11 }, { name: "小红", age: 12 } ] ]
老师你好,请问如果请求到的是一串类似【student: "张三$12#李四$13$$$小芳$11#小红$12"】这样的字符串,如何才能转换拼接成下面这种形式的数组?
student:[ boy:[ { name: "张三", age: 12 }, { name: "李四", age: 13 } ], girl: [ { name: "小芳", age: 11 }, { name: "小红", age: 12 } ] ]
2019-06-12
举报