CoreFiles by mySites.guru
Str.php30 lines, 746 bytes, from Joomla_6.3.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 6.2.0-alpha3
md5
b9813fb74a9ea4b2d233286a6ead9337
sha1
b30a688341217260c5802c97c19ad9217a591c64
sha256
cf1569a336cc24a5b3cea4899a9d4059923725a365315ba4d4c2eb38fd2dbd15
<?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 158 releases, Joomla 5.0.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.