add findTrim function.