Trim function

Trim a Vector