joomla/joomla-cms — pull request #4492 by infograf768 (2014-10-09 14:56:15+00:00)
Title: [imp] Adding method to trim normal, non-breaking and multibyte spaces

See discussion https://github.com/joomla/joomla-cms/pull/4489

the code to use would be:
```
JFilterInput::getInstance()->clean((string) $mystring, 'trim')
```