public static function replace($search, $replace, $string, $caseSensitive = true)
    {
        if (!self::isValid($replace)) {
            return false;
        }

        if (!$caseSensitive) {
            return str_ireplace($search, $replace, $string);
        } else {
            return str_replace($search, $replace, $string);
        }
    }