Add left and right only trimming capabilities

I needed this functionality for left only trimming, so decided to also add right trimming for completeness.