How can I extend or trim line/linestring against mesh?

Hi

Simple question but I have no solution to this issue, How can I extend or trim line/ line string against mesh?

Regards
Tom