Added trim and trim_copy variants.

Change-Id: Iae165b3d7fefb59476f3139679df439cb94b5729
Merge "Added trim and trim_copy variants."