Replaced use of trim method for better backwards compatibility.

I need at least backwards compatibility for IE8. So I written a custom adapter for "." but I still have problems with trim method and Iam not a big fan of adding methods to native classes.