r7794: add whitespace trim functions