public static function prependIfMissing($string, $prefix)
    {
        if (Strings::startsWith($string, $prefix)) {
            return $string;
        }
        return Strings::appendPrefix($string, $prefix);
    }
public static function prependIfMissing($string, $prefix)
    {
        if (Strings::startsWith($string, $prefix)) {
            return $string;
        }
        return Strings::appendPrefix($string, $prefix);
    }
public static function prependIfMissing ( $ string , $ prefix ) { if ( Strings :: startsWith ( $ string , $ prefix ) ) { return $ string ; } return Strings :: appendPrefix ( $ string , $ prefix ) ; }
Adds prefix to the string, if string does not start with the prefix already.

Example:
<code>
$string = 'Daenerys Targaryen';
$stringWithPrefix = Strings::appendMissingPrefix($string, 'Daenerys ');
</code>
Result:
<code>
Daenerys Targaryen
</code>

@param string $string
@param string $prefix
@return string
Adds prefix to the string if string does not start with the prefix already .