public function endsWith($string, $search, $position = null)
    {
        $string = (string)$string;

        $position = $position !== null ? $position : mb_strlen($string, 'UTF-8');
        $position = $position - mb_strlen($search, 'UTF-8');
        return mb_strrpos($string, $search, null, 'UTF-8') === $position;
    }