Nodejs String Ends With endsWith(t, i)

Here you can find the source of endsWith(t, i)

Method Source Code

String.prototype.endsWith = function(t, i) {
  if (i == false) {
    return (t == this.substring(this.length - t.length));
  } else {/*from www  .  j  a v a2 s.  c o m*/
    return (t.toLowerCase() == this.substring(this.length - t.length).toLowerCase());
  }
};

Related

  1. endsWith(suffix)
    String.prototype.endsWith = function(suffix) {
        return this.indexOf(suffix, this.length - suffix.length) !== -1;
    };
    String.prototype.replaceAll = function (replaceThis, withThis) {
        var re = new RegExp(replaceThis,"g");
        return this.replace(re, withThis);
    };
    
  2. endsWith(suffix)
    String.prototype.endsWith = function(suffix) {
        return this.indexOf(suffix, this.length - suffix.length) !== -1;
    };
    function isImage(link) {
      return link.data.url.endsWith("jpg") || link.data.url.endsWith("png");
    window.onload = function() {
      chrome.topSites.get(buildPopupDom);
    
  3. endsWith(suffix)
    String.prototype.endsWith = function(suffix) {
      return this.slice(-suffix.length) == suffix;
    
  4. endsWith(suffix)
    String.prototype.endsWith = function(suffix) {
        return this.indexOf(suffix, this.length - suffix.length) !== -1;
    };
    
  5. endsWith(suffix)
    String.prototype.endsWith = function (suffix) {
      return this.substring(this.length - suffix.length) == suffix;
    };
    
  6. endsWith(test)
    String.prototype.endsWith = function(test) {
      return this.length >= test.length && this.substr(this.length - test.length) == test;
    
  7. endsWith(text)
    String.prototype.endsWith = function (text) {
      return this.substring(this.length - text.length) === text;
    };
    
  8. endsWith(text)
    String.prototype.endsWith = function(text) {
        return text != null && this.lastIndexOf(text) == this.length - text.length;
    };
    
  9. endsWith(value)
    String.prototype.endsWith = function(value) {
      if (!value)
        return false;
      if (value.length > this.length)
        return false;
      var end = this.substring(this.length - value.length);
      return end === value;
    };