Drop part of a cell value after a specific character

I have one cell that contains a long string of several values separated by “|”.

EXAMPLE in Cell B5

title | time | location | cost 

I need a formula that will show the value of B5, but only the characters before the first “|”.

Is it possible to trim everything including and following a specific character?