我有一个来自MongoDB的JSON返回字符串
[{'api_calls_per_day': 0.29411764705882354, '_id': ObjectId('51948e5bc25f4b1d1c0d303a'), 'api_calls_total': 5, 'api_calls_with_key': 3, 'api_calls_without_key': 2}]
我想从上面的字符串中去掉小括号“[”和“]”,结果如下:
^{pr2}$
你知道怎么把小括号从字符串中去掉吗?谢谢
Tags:
使用字符串方法:
它是Python,string是一个列表。这个怎么样
你得到一根绳子了吗?如果你是,那就是:
{a从a到substring}。在
如果它不是一个字符串,实际上是一个列表,那么只需获取第一个(也是唯一的元素),即json对象。在
^{pr2}$相关问题 更多 >
编程相关推荐