How to remove leading or trailing spaces from copy/paste operations? I usually have to copy/paste test from web pages (or other places) and paste it into HTML forms (usually Chrome).

The problem is that ofter I do end-up with a text that has additional leading or trailing spaces.

Is there a way to prevent this, by default? Like an OS X application or Chrome extension that can trick how paste works?
There´s an app for that.
ClipMenu besides keeping a clipboard history it is possible to assign scripts to the entries.
(1) You copy as usual
(2) click on ClipMenu's status bar icon, select your latest entry, and use a user-selectable key-click command to perform LTrim or RTrim on the entry.
ClipMenu is freeware.