title: Python Split string with a string that is on new line
body: <p>I am trying to split a string with a word that is on a new line by itself.</p>
  <p>For example, I want to split the string into parts whenever I encounter the word &quot;SPLIT&quot;. For my use case the word &quot;SPLIT&quot; should only be all by itself on a new line:</p>
  <p>I tried <code>str.split(&quot;\nSPLIT&quot;)</code>, but having trouble making it work for after the word.</p>
  <pre><code>Hello there,
  SPLIT
  how are you?
  </code></pre>
  <p>should return [&quot;Hello there,&quot;, &quot;how are you?&quot;]</p>
  <pre><code>Hello there, SPLIT how are you?
  </code></pre>
  <p>should return [&quot;Hello there, SPLIT how are you?&quot;]</p>
  <pre><code>Hello there,
  SPLIT
  </code></pre>
  <p>should return [&quot;Hello there,&quot;, &quot;&quot;]</p>
  <pre><code>Hello there,
  SPLIT how are you?
  </code></pre>
  <p>should return [&quot;Hello there,\nSPLIT how are you?&quot;]</p>
  <p>Appreciate the help.</p>