Is there an easy way to test a Python string "xxxxABCDyyyy" to see if "ABCD" is contained within it?
you can use . indexOf() and . lastIndexOf() to determine if an index is repeated. Meaning, if the first occurrence of the character is also the last occurrence, then you know it doesn't repeat.
if "ABCD" in "xxxxABCDyyyy": # whatever
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