How can I search for a certain string in multiple files (with a given extension) in a directory and replace everything afterwards (including the search string) with a blank string?
Example
I'm searching for 'mystring'
File contains:
foo bar mystring bar foo
I'm trying to get to:
foo bar