📜  如何更改字典列表中的特定文本 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:44.636000             🧑  作者: Mango

代码示例1
#how to remove special character inside a list containing dictionary values.
list_of_dictionary=[{"text":"$%&yahoo","zoombie":"you"},{"text":"i am zain%%%","greeting":"hello"}]
for i,j in enumerate(list_of_dictionary):
   text=j['text']
   text_1 =re.sub('\W+', ' ',text)
   list_of_dictionary[i]['text']=text_1
print(list_of_text)