title: Why is this "in" statement not evaluating to True?
body: <p>I have this code here</p>
  
  <pre><code>input1 = input("Toppings: ")
  split = input1.split("|")
  length = len(split)
  
  for i in range(0, length-1):
    if "cheese" in str(split[i]):
      del split[i]
  
  s = "|"
  print(s.join(split))
  </code></pre>
  
  <p>and it's meant to take a string, split it by <code>"|"</code> into an array, then search the array for the string <code>"cheese"</code>, and if it finds it; take it out of the array, and then print out the parsed array.</p>
  
  <p>When inputting this:</p>
  
  <pre><code>Toppings: ham|lettuce|cheddar cheese|sliced cucumber|tomato
  ham|lettuce|sliced cucumber|tomato
  </code></pre>
  
  <p>The output is correct - it removes the element that has <code>"cheese"</code> in it from the array. However, when inputting this:</p>
  
  <pre><code>Toppings: egg|lettuce|cheese spread|mac'n'cheese
  egg|lettuce|mac'n'cheese
  </code></pre>
  
  <p>It doesn't remove it from the array. When I looked up the <code>in</code> operator it said it <em>didn't</em> match whole word only so I thought it would work. What would be the correct code to put into the <code>if</code> statement so it would detect <code>"cheese"</code> in <code>"mac'n'cheese"</code>?</p>