我正在调用一个返回包含字典的字符串的函数。我怎样才能提取这个字典,记住第一行和最后一行可能包含“{”和“}”。
This is a {testing string} example
This {is} a testing {string} example
{"website": "stackoverflow",
"type": "question",
"date": "10-09-2020"
}
This is a {testing string} example
This {is} a testing {string} example
Run Code Online (Sandbox Code Playgroud)
我需要将此值提取为字典变量。
{"website": "stackoverflow",
"type": "question",
"date": "10-09-2020"
}
Run Code Online (Sandbox Code Playgroud)