Issue 1675 - Use String.trim() to strip leading and trailing whitespaces

--HG--
extra : rebase_source : b6df4094c5b2cffeb8905b744822051094baca1b