📌  相关文章
📜  从字符串python代码示例中删除单引号和双引号

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

代码示例1
a_string = '"ab"cd"'
stripped_string = a_string.strip('"') # Only removes quote marks at each end
                                      # of the string.
print(stripped_string)  #Output: ab"cd

replaced_string = a_string.replace('"',"") #Removes al quote marks from 
                                           # string.
print(replaced_string) #Output: abcd