public static function replaceFirst(string $search, string $replace, string $subject): string
    {
        if ($search === '') {
            return $subject;
        }

        $position = \mb_strpos($subject, $search);

        return self::replaceByPosition($subject, $replace, $position, $search);
    }
public static function replaceFirst(string $search, string $replace, string $subject): string
    {
        if ($search === '') {
            return $subject;
        }

        $position = \mb_strpos($subject, $search);

        return self::replaceByPosition($subject, $replace, $position, $search);
    }
public static function replaceFirst ( string $ search , string $ replace , string $ subject ) : string { if ( $ search === '' ) { return $ subject ; } $ position = \ mb_strpos ( $ subject , $ search ) ; return self :: replaceByPosition ( $ subject , $ replace , $ position , $ search ) ; }
Replace the first occurrence of a given value in the string.

@param string $search
@param string $replace
@param string $subject

@return string
Replace the first occurrence of a given value in the string .