Returns true iff str endsWith suffix (ignoreCase comparison)
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;
    }
1154183
function(str, end) {
    return (str.length >= end.length &&
            str.substring(str.length - end.length) === end);
  }
1221542
private function endswith($string, $suffix)
	{
		$strlen = strlen($string);
		$testlen = strlen($suffix);
		if ($testlen > $strlen) {
			return false;
		}

		return substr_compare($string, $suffix, -$testlen) === 0;
	}
154691
function endsWithString(endingValue, valueToTest) {
  const position = valueToTest.length - endingValue.length;
  const lastIndexOfValue = valueToTest.lastIndexOf(endingValue);

  return !!~lastIndexOfValue && lastIndexOfValue === position;
}
520599
public boolean endsWith(String str, String suffix) {
        return (str == null || suffix == null) ? (str == suffix) :
            str.endsWith(suffix);
    }
1323102
public static boolean endsWithIgnoreCase(@Nullable final String str,
      @Nullable final String suffix) {
    return str != null && suffix != null && str.length() >= suffix.length()
        && str.regionMatches(true, str.length() - suffix.length(), suffix, 0, suffix.length());
  }
1135349
boolean checkSuffix(char[] chars, int[] cursor) {
    if (suffix == null)
      return true;
    if (cursor[1] - cursor[0] < suffix.minlen)
      // a conservative test, but if we can't pass it, we'll certainly fail later
      return false;
    int last = suffix.items.length - 1;
    for (int i = last; i >= 0; i--) {
      Object item = suffix.items[i];
      if (item == Pattern.matchOne)
        if (!topicSkipBackward(chars, cursor))
          return false;
        else
          ; // topic skip succeeded so continue
      else if (!matchBackward(chars, (char[]) item, cursor))
        return false;
      // else this phase succeeded so continue
    }
    // The suffix matches exactly.  But, the preceding character MUST be a separator.  We
    // don't allow start-of-string because we would not have checked the suffix
    // at all if it were allowed to extend to the beginning (it would then be identical
    // to the prefix).
    return cursor[0] < cursor[1] && 
      chars[cursor[1]-1] == MatchSpace.SUBTOPIC_SEPARATOR_CHAR;
  }
551372
def keys_with_suffix(self, suffix):
        
        return [k.rstrip(suffix) for k in self.keys() if k.endswith(suffix)]
1183530
public static function endsWith($string, $suffix)
    {
        $string = is_int($string) ? "$string" : $string;
        $suffix = is_int($suffix) ? "$suffix" : $suffix;
        $suffixLength = mb_strlen($suffix);
        return is_string($string) && is_string($suffix) && mb_substr($string, -$suffixLength, $suffixLength) === $suffix;
    }
257758
public static function isEnd($haystack, $needle, $caseSensitive = false): bool
    {
        if ($caseSensitive) {
            return $needle === '' || self::sub($haystack, -self::len($needle)) === $needle;
        }

        $haystack = self::low($haystack);
        $needle = self::low($needle);

        return $needle === '' || self::sub($haystack, -self::len($needle)) === $needle;
    }
503682
function endsWith(str,test){
  var lastIndex = str.lastIndexOf(test);
  return (lastIndex != -1) && (lastIndex + test.length == str.length);
}
597344
public static boolean endsWithPunc(String str) {
		if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!") ||
			    str.endsWith(",") || str.endsWith(":") || str.endsWith("\"") || 
			    str.endsWith("'") || str.endsWith("''") || str.endsWith(";")) {
		    return true;
		}
		
		return false;
    }
882935
def endswith_strip(s, endswith='.txt', ignorecase=True):
    
    if ignorecase:
        if s.lower().endswith(endswith.lower()):
            return s[:-len(endswith)]
    else:
        if s.endswith(endswith):
            return s[:-len(endswith)]
    return s
1270845
function endsWith(str, ending) {
        if (str.length - ending.length === str.lastIndexOf(ending))
            return true;
        else return false;
    }
1154717
public function endsWith($string, bool $caseInsensitive = false): bool
    {
        try {
            Assert::typeOf(['string', __CLASS__], $string);
        } catch (InvalidArgumentException|TypeError $t) {
            return false;
        }

        $value  = (string) $string;
        $strLen = mb_strlen($value, $this->encoding);
        $length = $this->length();

        if ($strLen > $length) {
            return false;
        }

        return substr_compare($this->data, $value, $length - $strLen, $length, $caseInsensitive) === 0;
    }
1267190
def strip_required_suffix(string, suffix):
    
    if string.endswith(suffix):
        return string[:-len(suffix)]
    raise AssertionError('String ends with %r, not %r' % (string[-len(suffix):], suffix))
511142
function endsWith(longStr, shortStr) {
		var longLen = longStr.length, shortLen = shortStr.length;
		return (longLen >= shortLen) &&
			(longStr.substr(longLen - shortLen) === shortStr);
	}