modify string trim a bit and remove unneeded String.trimSequence()