str_replace or which other function to detect a word and delete everything after it?
<p>What function should I use to search for a string in a paragraph and then delete everything including and after that string?</p>

<p>So if I had a paragraph
"Marry had a little lamb and the wolf ate them all. Then marry went to Walmart for more lambs."</p>

<p>And I used a function to search "lamb" everything including lamb and stuff after it should be deleted. So the resulting text should be "Marry had a little"</p>
