Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

var str = "{"result":true,"key":"6100042518"}" 怎么取到key的值? 这本身就不算一个标准的字符串,语法都是报错的,但是后端改不了只能强行转化。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
611 views
Welcome To Ask or Share your Answers For Others

1 Answer

let str = `"{"result":true,"key":"6100042518"}"`
JSON.parse(str.slice(1,str.length-1)).key//掐头去尾

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...