去掉字符串中不想要的逗号,括号等
n = '[123,456,789]'
n = n.replace(',', '') # 去掉逗号
n = n.replace('[', '') # 去掉左括号
n = n.replace(']', '') # 去掉有括号
print(n)
>>>123456789
去掉字符串中不想要的逗号,括号等
n = '[123,456,789]'
n = n.replace(',', '') # 去掉逗号
n = n.replace('[', '') # 去掉左括号
n = n.replace(']', '') # 去掉有括号
print(n)
>>>123456789
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M