Return whether or not the provided subject ends with suffix.

@param string $subject
@param string $suffix
@param null|string $encoding

@return bool
@throws InvalidArgumentException
773694
public static function endsWith($subject, $suffix, $encoding = null)
    {
        return Rope::of($subject, $encoding)->endsWith($suffix);
    }
506178
public function ensureSuffix($substring, $encoding = null)
    {
        if (!$this->hasMbstring()) {
            $len = \strlen($substring);
            if (\substr($this->string, -$len) == $substring) {
                return $this;
            }
        } else {
            $encoding = $this->encoding($encoding);

            $len = \mb_strlen($substring, $encoding);
            if (\mb_substr($this->string, -$len, \mb_strlen($this->string, $encoding), $encoding) == $substring) {
                return $this;
            }
        }

        return $this->suffix($substring);
    }
768965
public static function eliminateDupilcates($subject, $eliminate = "\\")
    {
        $pattern = $eliminate . $eliminate;

        while (strpos($subject, $pattern) !== false) {
            $subject = str_replace($pattern, $eliminate, $subject);
        }

        return $subject;
    }
586910
public function validateEmailSubjectPrefix($subjectPrefix)
    {
        if (mb_strlen($subjectPrefix, 'UTF-8') > 255) {
            $this->addError(EmailConfigurationTransformer::EMAIL_SUBJECT_PREFIX, 'Subject prefix length has to be less or equal to 255');
            return false;
        }

        return true;
    }
470142
@Nullable
    public static String ensureEndsWith(@CheckForNull String subject, @CheckForNull String suffix) {

        if (subject == null) return null;

        if (subject.endsWith(suffix)) return subject;

        return subject + suffix;
    }
825024
public function match(string $subject, $flags = 0, $offset = 0): int
	{
		$this->clean();
		return preg_match($this->pattern, $subject, $this->last_match, $flags, $offset);
	}
522012
protected function isSubjectSupported($subject)
    {
        if (null === $subject || \is_string($subject) || $subject instanceof FieldVote || \is_object($subject)) {
            return true;
        }

        return \is_array($subject)
            && isset($subject[0], $subject[1])

            && (\is_string($subject[0]) || \is_object($subject[0]))
            && \is_string($subject[1]);
    }
689822
public static function beginsWith($subject, $prefix, $encoding = null)
    {
        return Rope::of($subject, $encoding)->beginsWith($prefix);
    }
887343
public function endsWithIgnoreCase($suffix) {
		$other = new Str($suffix, $this->charset);

		return mb_strripos($this->rawString, $suffix, 0, $this->charset) === ($this->length() - $other->length());
	}
629685
public boolean endsWith(Bytes suffix) {
    Objects.requireNonNull(suffix, "endsWith(Bytes suffix) cannot have null parameter");
    int startOffset = this.length - suffix.length;

    if (startOffset < 0) {
      return false;
    } else {
      int end = startOffset + this.offset + suffix.length;
      for (int i = startOffset + this.offset, j = suffix.offset; i < end; i++, j++) {
        if (this.data[i] != suffix.data[j]) {
          return false;
        }
      }
    }
    return true;
  }
1101338
public static function endsWith($string, $suffix) {
    return (mb_strrpos($string,$suffix) === mb_strlen($string) - mb_strlen($suffix));
  }
32312
public function match(Subject $subject, string $verb): bool
    {
        return $this->subject->getType() == $subject->getType() &&
            $this->subject->getId() === $subject->getId() &&
            ($this->verbs === null || in_array($verb, $this->verbs, true));
    }
324281
public static boolean endsWithIgnoreCase(String str, String suffix) {
        if (str == null || suffix == null)
            return false;

        int strLength = str.length();
        int suffixLength = suffix.length();

        // return false if the string is smaller than the suffix.
        if (strLength < suffixLength)
            return false;

        // perform regionMatch with ignorecase
        if (str.regionMatches(true, strLength - suffixLength, suffix, 0, suffixLength))
            return true;

        return false;
    }
653985
public static function endsWith(?string $what, ?string $where): bool
    {
        // check is not empty string
        if (self::likeEmpty($what) || self::likeEmpty($where)) {
            return false;
        }

        $suffix = self::sub($where, -self::length($what));
        return $suffix === $what;
    }
994633
public static function endsWith($str, $suffix)
    {
        return stripos($str, $suffix) === strlen($str) - strlen($suffix);
    }
41590
protected function setSuffix($suffix)
    {
        if (is_null($suffix) or is_bool($suffix)) {
            $this->suffix = null;
        } elseif ($suffix === '/') {
            $this->suffix = $suffix;
        } else {
            $this->suffix = '.' . trim($suffix, '.');
        }
    }
333463
public static function strIs($patterns, $subject, &$matchedPattern = '', $caseSensitive = false)
    {
        if (!is_array($patterns)) {
            $patterns = (array) $patterns;
        }

        $lowerSubject = strtolower($subject);

        foreach ($patterns as $pattern) {

            if ($caseSensitive) {
                if (str_is($pattern, $subject)) {
                    $matchedPattern = $pattern;
                    return true;
                }
            } else {
                $lowerPattern = strtolower($pattern);
                if (str_is($lowerPattern, $lowerSubject)) {
                    $matchedPattern = $pattern;
                    return true;
                }
            }

        }

        return false;
    }