title: How can I remove the date and time from a string IF it contains it?
body: <p>I have a list of strings.  Some of them contain a date and timestamp at the end, but most don't. The date/time format will always be the same format. </p>
  
  <pre><code>sampleString = ['String 1', 'String2', 'String 3 05.24.2019 04:48:24']
  </code></pre>
  
  <p>I am looking for a statement like this:</p>
  
  <pre><code>if 'MM.DD.YYYY' in sampleString:
      samplestring = samplestring.split('MM.DD.YYYY')[0]
  
  print(sampleString)
  &gt;&gt;&gt;['String 1', 'String2', 'String 3']
  </code></pre>
  
  <p>But that is clearly not working. Any help is appreciated. </p>