public function trim($string, $charlist = null)
    {
        $string = (string)$string;

        if ($charlist === null) {
            return trim($string);
        } else {
            return trim($string, $charlist);
        }
    }
public function trim($string, $charlist = null)
    {
        $string = (string)$string;

        if ($charlist === null) {
            return trim($string);
        } else {
            return trim($string, $charlist);
        }
    }
public function trim ( $ string , $ charlist = null ) { $ string = ( string ) $ string ; if ( $ charlist === null ) { return trim ( $ string ) ; } else { return trim ( $ string , $ charlist ) ; } }
Trim whitespace at the beginning and end of a string

@param string $string The string to trim
@param string $charlist List of characters that should be trimmed, defaults to whitespace
@return string The trimmed string
Trim whitespace at the beginning and end of a string