trim( String $str, [String $charlist] )

trim ( "", "" );

returned: []
(Wrapped in [] to better show any extra spaces)

Pattern charList