public static function appendIfMissing($string, $suffix)
    {
        if (Strings::endsWith($string, $suffix)) {
            return $string;
        }
        return Strings::appendSuffix($string, $suffix);
    }
public static function appendIfMissing($string, $suffix)
    {
        if (Strings::endsWith($string, $suffix)) {
            return $string;
        }
        return Strings::appendSuffix($string, $suffix);
    }
public static function appendIfMissing ( $ string , $ suffix ) { if ( Strings :: endsWith ( $ string , $ suffix ) ) { return $ string ; } return Strings :: appendSuffix ( $ string , $ suffix ) ; }
Adds suffix to the string, if string does not end with the suffix already.

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

@param string $string
@param string $suffix
@return string
Adds suffix to the string if string does not end with the suffix already .