CoreFiles by mySites.guru
Str.php30 lines, 748 bytes, from Joomla_4.3.2-Stable-Full_Package.zip
Raw History Compare with 4.3.1
md5
bdf89177954cfd9a324c9632e46dd90d
sha1
a2d881754798d91cf0b3843ebc46ba737e6fa032
sha256
d94a5efbc6dd61968312616858785e8bd0e097a3ebe2c64ec69d937244c9c045
<?php

declare(strict_types=1);

namespace Jfcherng\Diff\Utility;

final class Str
{
    /**
     * Determine if a given string starts with a given substring.
     *
     * @param string $haystack the haystack
     * @param string $needle   the needle
     */
    public static function startsWith(string $haystack, string $needle): bool
    {
        return \substr($haystack, 0, \strlen($needle)) === $needle;
    }

    /**
     * Determine if a given string ends with a given substring.
     *
     * @param string $haystack the haystack
     * @param string $needle   the needle
     */
    public static function endsWith(string $haystack, string $needle): bool
    {
        return \substr($haystack, -\strlen($needle)) === $needle;
    }
}

The same content is in 56 releases, Joomla 4.3.0-alpha1 to 4.4.14. See them all, or every version of this file.