Added trim, trim_left and trim_right functions