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.
我正在遍历 python 中的字符串,我想检查每个字符是否等于". 我该怎么做呢?
"
像这样:
for c in theString: if c == '"': print 'Aha!'
您也可以像这样直接获取第一个引号的索引:
theString.index('"')