Trimming is a UI function in my opinion, so should be the responsibility of the caller.