trim on substring