Which is the fastest way to search if a string contains another string based on a list?
This one works fine, but is too slow for me when the string is large and the list is long.
test_string = "Hello! This is a test. I love to eat apples."
fruits = ['apples', 'oranges', 'bananas']
for fruit in fruits:
if fruit in test_string:
print(fruit+" contains in the string")