python 去掉字符串的 "

list_name = ["hello", "", "许言午", "公司", "赵六", "wangwu", "太司", "许春林", "测试", "zhangsan"]

# 第一种方法: 我们在views中使用replace

print list_name.replace('\"','')

# 第二种方式 把变量list_name 传递到前台,在前台的页面处理

< input id = 'list_name' type = "hidden" value = "{{ list_name }}" >
var list_name = $('#list_name').val().replace( / "|\[|\]/g, '').split(',');

 

posted @ 2017-04-07 01:31  淋哥  阅读(3838)  评论(0编辑  收藏  举报