I am iterating through a string in python and I want to check each character to see if it equals "
. How do I go about doing this?
Like this:
for c in theString:
if c == '"':
print 'Aha!'
You can also directly get the index of the first quote like so:
theString.index('"')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With