Check if the current string ends with the given string

@param string $value

@return bool
976892
public function endsWith(string $value): bool
    {
        if ($value === '') {
            return true;
        }

        return (string) $this->takeEnd(self::of($value, $this->encoding)->length()) === $value;
    }
665114
public function contains(string $value): bool
    {
        try {
            $this->position($value);

            return true;
        } catch (SubstringException $e) {
            return false;
        }
    }
803716
public static function email(string $value): bool
    {
        $result = filter_var($value, FILTER_VALIDATE_EMAIL);
        return is_string($result) && $value === $result;
    }
10375
protected function checkValidity($value) : bool
    {
        if (preg_match(static::$regex, $value)) {
            return true;
        } elseif ('' === $value) {
            return true;
        } else {
            return false;
        }
    }
357290
public function checkChars($value)
    {
        if (!is_string($value)) {
            return false;
        }

        $characters = $this->getCharacters();
        if ($characters == 128) {
            for ($x = 0; $x < 128; ++$x) {
                $value = str_replace(chr($x), '', $value);
            }
        } else {
            $chars = str_split($characters);
            foreach ($chars as $char) {
                $value = str_replace($char, '', $value);
            }
        }

        if (strlen($value) > 0) {
            return false;
        }

        return true;
    }
897817
protected function isValidToken($value)
    {
        // Make sure the value has the right format
        $value   = $this->tracker->filterToken($value);
        $library = $this->tracker->getTokenLibrary();
        $format  = $library->getFormat();
        $reuse   = $library->hasReuse() ? $library->getReuse() : -1;

        if (strlen($value) !== strlen($format)) {
            $this->_messages = sprintf($this->translate->_('Not a valid token. The format for valid tokens is: %s.'), $format);
            return false;
        }

        $token = $this->tracker->getToken($value);
        if ($token && $token->exists && $token->getReceptionCode()->isSuccess()) {
            $currentDate = new \MUtil_Date();

            if ($completionTime = $token->getCompletionTime()) {
                // Reuse means a user can use an old token to check for new surveys
                if ($reuse >= 0) {
                    // Oldest date AFTER completiondate. Oldest date is today minus reuse time
                    if ($currentDate->diffDays($completionTime) <= $reuse) {
                        // It is completed and may still be used to look
                        // up other valid tokens.
                        return true;
                    }
                }
                $this->_messages = $this->translate->_('This token is no longer valid.');
                return false;
            }

            $fromDate = $token->getValidFrom();
            if ((null === $fromDate) || $currentDate->isEarlier($fromDate)) {
                // Current date is BEFORE from date
                $this->_messages = $this->translate->_('This token cannot (yet) be used.');
                return false;
            }

            if ($untilDate = $token->getValidUntil()) {
                if ($currentDate->isLater($untilDate)) {
                    //Current date is AFTER until date
                    $this->_messages = $this->translate->_('This token is no longer valid.');
                    return false;
                }
            }

            return true;
        } else {
            $this->_messages = $this->translate->_('Unknown token.');
            return false;
        }
    }
570722
public function isValid($value)
    {
        foreach ((array) $value as $val) {
            if (\MUtil_String::contains($val, $this->_options[0])) {
                return true;
            }
        }
        return false;
    }
142546
public static function isValid($value)
    {
        if (is_string($value)) {
            $value = [ $value ];
        }
        
        if (!is_array($value) || count($value) === 0) {
            return false;
        }

        foreach ($value as $ep) {
            if (!is_string($ep)) {
                return false;
            }
            $type = self::getType($ep);

            if ($type === null) {
                return false;
            }
        }
        return true;
    }
264555
public function isTemporary(string $value): bool
    {
        try {
            $response = $this->client->request('GET', sprintf('%s/detect/%s', self::API_URL, $value));
        } catch (GuzzleException $exception) {
            throw Exception::fromMessage($exception->getMessage());
        }

        $decoded = json_decode($response->getBody()->getContents(), true);

        return (bool)($decoded['temporary'] ?? false);
    }
23736
private function check($value) {

		if(true === is_string($value)) {

 			$value = preg_replace('/^([a-z]+):\/\//i', '', $value);

 			return true === (gethostbyname($value) && checkdnsrr($value, 'A'));
 		}

 		return false;
	}
1255592
public function checkEndsWith($value, $end)
    {
        if (!Type::isStringable($value)) {
            return false;
        }

        return Helper::endsWith("$value", $end);
    }
202090
public function checkChars($value)
    {
        if (strlen($value) != 8) {
            if (strpos($value, 'X') !== false) {
                return false;
            }
        }

        return parent::checkChars($value);
    }
912223
public function isBlank($value)
    {
        // Be very sure!
        if ($value === null || strlen($value) === 0 || trim($value) === '') {
            return true;
        }

        return false;
    }
832869
public static function isString($value)
    {
        if (is_object($value) && method_exists($value, '__toString')) {
            return true;
        }

        if (is_null($value)) {
            return true;
        }

        return is_scalar($value);
    }
775089
public static function isStringable($value)
	{
		return is_string($value)
				|| is_null($value)
				|| (is_object($value) && method_exists($value, '__toString'))
				|| is_scalar($value);
	}
753714
public static function isRequire($value)
    {
        if (is_null($value)) {
            return false;
        } elseif (is_string($value) && trim($value) === '') {
            return false;
        }

        return true;
    }
1273683
private function hasColon($value)
    {
        $colons = [':', '%3A', '%3a'];
        foreach ($colons as $colon) {
            if (false !== strpos($value, $colon)) {
                return true;
            }
        }

        return false;
    }