[FIXED JENKINS-24434] fix trim() usage

bug 24434 is caused by removal of all whitespace by trim() function. it looks like only eol character removal was intended.

fix tested & verified with jenkins 1.528.