Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串,其中包含: " ' : ; 我正在使用.translate(None," "':; ") 但这不起作用,因为""在打开和关闭逗号时面临歧义。 请帮忙
" ' : ;
.translate(None," "':; ")
""
转义引用:
foo.translate(None," \"':; ")
I need to convert one object to another...in both cases of a single instance of the object as well as corresponding Lists of those objects. I'd rather not have to perform the same mappings in 2 place