public static function replaceFirst($search, $replace, $subject, $caseSensitive = true)
    {
        if ($caseSensitive) {
            $pos = strpos($subject, $search);
        } else {
            $pos = stripos($subject, $search);
        }
        if ($pos !== false) {
            return substr_replace($subject, $replace, $pos, strlen($search));
        }
        return $subject;
    }