public static function beginsWith(
        string $haystack,
        string $needle,
        bool $caseSensitive = false
    ): bool
    {
        $length = strlen($needle);
        return ($caseSensitive === false)
            ? strncasecmp($haystack, $needle, $length) === 0
            : strncmp($haystack, $needle, $length) === 0;
    }